home *** CD-ROM | disk | FTP | other *** search
- Path: news.larc.nasa.gov!amiga-request
- From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
- Subject: v91i041: MakeMenu 1.0 - Intuition menu structure coding tool, Part01/02
- Reply-To: hj@philtis.cft.philips.nl (Hans Jansen @ PMSN)
- Newsgroups: comp.sources.amiga
- Message-ID: <comp.sources.amiga:v91i041@ab20.larc.nasa.gov>
- Date: 03 Mar 91 23:15:42 GMT
- Approved: tadguy@uunet.UU.NET (Tad Guy)
- X-Mail-Submissions-To: amiga@uunet.uu.net
- X-Post-Discussions-To: comp.sys.amiga.misc
-
- Submitted-by: hj@philtis.cft.philips.nl (Hans Jansen @ PMSN)
- Posting-number: Volume 91, Issue 041
- Archive-name: utilities/makemenu-1.0/part01
-
- [ includes uuencoded executables and objects ...tad ]
-
- This package aims to facilitate the design and coding of Intuition
- Menu structures. It consists of two programs, the actual MakeMenu
- program, which creates a C code file from a simple menu description
- file, and a TestMenu program, which, when linked with the compiled
- output of MakeMenu, enables you to view the menu without having to
- build a complete application around it. Adapted from menuBuilder on
- Fish Disk #65. Version 1.0, includes source.
- Author: Hans Jansen.
-
-
- #!/bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 2)."
- # Contents: MakeMenu.doc README TestMenu.uu makefile makemenu.c
- # makemenu.o.uu menu.c menu.o.uu menu.test testmenu.c testmenu.o.uu
- # Wrapped by tadguy@ab20 on Sun Mar 3 18:15:38 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'MakeMenu.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MakeMenu.doc'\"
- else
- echo shar: Extracting \"'MakeMenu.doc'\" \(7023 characters\)
- sed "s/^X//" >'MakeMenu.doc' <<'END_OF_FILE'
- X MakeMenu V1.0 (15-oct-90) - by Hans Jansen
- X
- X
- X This package aims to facilitate the design and coding of Intuition Menu
- X structures. It consists of two programs, the actual MakeMenu program, which
- X creates a C code file from a simple menu description file, and a TestMenu
- X program, which, when linked with the compiled output of MakeMenu, enables
- X you to view the menu without having to build a complete application around
- X it.
- X
- XMakeMenu:
- X
- X This program was adapted from "Menu Builder V1.0" by Custom Services, as
- X published on Fish Disk #65.
- X The original program contains the following copyright statement:
- X
- X ___________________________________________________________________________
- X| |
- X| This Software is Copyrighted 1986 by Custom Services |
- X| All rights to this and the generated data are the property |
- X| of Custom Services and may not be used for Commercial purposes |
- X| without the express written consent of Custom Services. |
- X|___________________________________________________________________________|
- X
- X I adapted the program to my own, somewhat extended, needs because it
- X originally only generated menu items with the CHECKIT attribute,
- X without even so much as highlighting the selected item.
- X
- X
- X Like its predecessor, MakeMenu takes a simple sequential file and
- X from that file generates the menu structures for a program.
- X
- X Call:
- X MakeMenu ifile ofile
- X
- X ifile :
- X The menu descriptor file, containing lines of the form:
- X
- X MENU,[Flags],Name
- X ITEM,[Flags],Name,[Select],[Command]
- X SUBI,[Flags],Name,[Select],[Command]
- X
- X Name is the name of the Menu, Item or SubItem.
- X
- X Select is an optional name which will display when the item is
- X clicked upon.
- X
- X Command is the Character to use for selection of the menu item with
- X the AMIGA key. Only single letters A-Z are allowed. The letters
- X M and N are not allowed since Intuition uses these for screen control.
- X
- X Flag (for menu entry):
- X "D" specifies the menu to be disabled.
- X Default attributes for a Menu's Flags field are:
- X MENUENABLED.
- X
- X Flags (for menu item entry):
- X "D" specifies the menu to be disabled.
- X "T" sets the item attribute MENUTOGGLE;
- X "C" sets the item attribute CHECKIT;
- X "S" sets the item attribute CHECKED ("Selected").
- X Default attributes for an Item's or SubItem's Flags field are:
- X ITEMENABLED | ITEMTEXT | HIGHCOMP.
- X Note that no plausibility check is done on the combination of these
- X attributes!
- X
- X ofile :
- X The resulting C code file, compilable as is! You may, however,
- X edit the source to modify the options.
- X
- X Processing:
- X
- X The text file is read line by line and the data saved in the regular
- X Intuition structures. After all data is read and no errors have
- X been found the program will output to STDOUT all the text needed to
- X generate the menu described. If sub menus are specified the position
- X of the sub menu will be about 40 % overlapped with the linked menu item.
- X
- X The positioning of a menu will be automatically calculated based on the
- X length of the strings used in the menu to the left of this one. The
- X widest string will be used to base the width. Most of this processing
- X is contained in the function Do_Output; change its parameters as needed.
- X
- X The structs Menu, MenuItem, and IntuiText will be generated as needed
- X to define the menus based on the input file.
- X
- X You will need to include the statement:
- X
- X extern struct Menu *MyMenu;
- X
- X in your source program and call:
- X
- X SetMenuStrip (window_ptr, MyMenu);
- X
- X Also, before you close your window you must call:
- X
- X ClearMenuStrip (window_ptr);
- X
- X or risk a spectacular crash!
- X
- XTestMenu:
- X
- X This program was adapted from the Intuition/Menus example in pages
- X 125-133 of the V1.3 RKM "Libraries and Devices:, also published on
- X Fish Disk #344 (the "Libs&DevsCompanion"). On that disk, the program
- X carried the following copyright statement:
- X
- X/* Copyright (c) 1990 Commodore-Amiga, Inc.
- X *
- X * This example is provided in electronic form by Commodore-Amiga, Inc. for
- X * use with the 1.3 revisions of the Addison-Wesley Amiga reference manuals.
- X * The 1.3 Addison-Wesley Amiga Reference Manual series contains additional
- X * information on the correct usage of the techniques and operating system
- X * functions presented in this example. The source and executable code of
- X * this example may only be distributed in free electronic form, via bulletin
- X * board or as part of a fully non-commercial and freely redistributable
- X * diskette. Both the source and executable code (including comments) must
- X * be included, without modification, in any copy. This example may not be
- X * published in printed form or distributed with any commercial product.
- X * However, the programming techniques and support routines set forth in
- X * this example may be used in the development of original executable
- X * software products for Commodore Amiga computers.
- X * All other rights reserved.
- X * This example is provided "as-is" and is subject to change; no warranties
- X * are made. All use is at your own risk. No liability or responsibility
- X * is assumed.
- X */
- X
- X This program, when linked with the (compiled) output from MakeMenu,
- X will enable you to fast-prototype your menu design. The program will
- X report the menu/item/subitem numbers for any selection you make.
- X
- XUsage of the package:
- X
- X Build your menu description file with any text editor. Run it through
- X MakeMenu by a command like
- X MakeMenu menu.test menu.c
- X Then compile the resulting .c file and link the object with your own
- X application. That is all there is to it!
- X
- X The supplied makefile (for PDC V3.3) will automatically build a new
- X executable for the test program TestMenu, when you define a new menu in
- X the file Menu.Test; the resulting output file will be called Menu.c.
- X When all goes well, it will also run the TestMenu program to let you
- X view your menu.
- X
- XBugs:
- X
- X You must be kidding! I don't write any bugs into my software! [(:-)]
- X However, should you find anything wrong with the program, I should be
- X pleased to hear about it. Please e-mail me to the address below.
- X
- X Notice that currently there is no way to generate mutual-exclusion
- X flags. Should I ever appear to need that functionality, I will probably
- X add it and repost the package. I have no way to predict when that will
- X be, if ever.
- X You are free to do with the package as you like; but in case of any
- X extensions being added I should still like to have a copy.
- X
- X This package has been developed using PDC V3.33. I have not tried to
- X produce a makefile compatible to Aztec or SAS C; but I do not believe
- X adaptation to those environments will give any problems.
- X
- X--
- XJ (Hans) W Jansen @ Philips Medical Systems Nederland, Dept. DA&S-EDM
- XBuilding QP-1115 PO Box 10000 5680 DA Best The Netherlands
- XUUCP: hj@philtis.cft.philips.nl Voice: +31 040 763342
- END_OF_FILE
- if test 7023 -ne `wc -c <'MakeMenu.doc'`; then
- echo shar: \"'MakeMenu.doc'\" unpacked with wrong size!
- fi
- # end of 'MakeMenu.doc'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(474 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- XThis package aims to facilitate the design and coding of Intuition
- XMenu structures. It consists of two programs, the actual MakeMenu
- Xprogram, which creates a C code file from a simple menu description
- Xfile, and a TestMenu program, which, when linked with the compiled
- Xoutput of MakeMenu, enables you to view the menu without having to
- Xbuild a complete application around it. Adapted from menuBuilder on
- XFish Disk #65. Version 1.0, includes source.
- XAuthor: Hans Jansen.
- X
- END_OF_FILE
- if test 474 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'TestMenu.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'TestMenu.uu'\"
- else
- echo shar: Extracting \"'TestMenu.uu'\" \(16283 characters\)
- sed "s/^X//" >'TestMenu.uu' <<'END_OF_FILE'
- Xbegin 700 TestMenu
- XM```#\P`````````;`````````!H````"````#@```<$```:_````!P````4`.
- XM```'````!P````0````$````!`````4````'````!@````8````&````!0``]
- XM``4````%````!0````8````%````!0````8````%````!P````8```/I````C
- XM`D[Y```````````#[`````$````#`````@````````/R```#ZP````X```/RD
- XM```#Z@```<$`(0`!````````````````____________________________\
- XM____````````````````````````````````````````````````````````]
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM``````````````,``0``%``4````````!9P`````````"@*``&0"`0```P``#
- XM`A`.``````````````5P````````````````_____P`!``$!```3````````G
- XM```&J````````0$``!,```````````:B```````!`0``$P``````````!IP`B
- XM``````$!```3```````````&E````````0$``!,```````````:.```````!9
- XM`0``$P``````````!HH```````$!```3```````````&A````````0$``!,`8
- XM``````````9Z```````!`0``$P``````````!G0```````$!```3````````D
- XM```&;@```````0$``!,```````````9J```````!`0``$P``````````!F0`X
- XM``````$!```3```````````&7@```````0$``!,```````````94```````!I
- XM`0``$P``````````!DX```````$!```3```````````&1````````0$``!,`<
- XM``````````8T```````!`0``$P``````````!B@````````#D@`X``(`8P`*Y
- XM`%(````````";`````````````#__P``````.``,`&,`"@!2`````````H``#
- XM````````````__\```/6``````!C``H`4@````````((`````````````/__>
- XM```#^`````H`8P`*`%8````````"'`````!/``````#__P``!!H````4`&,`(
- XM"@!6`````````C``````4P``````__\```0\````'@!C``H`4@````````)$&
- XM`````````````/__```$7@```"@`8P`*`%(````````"6````````````W#_3
- XM_P``!(`````R`&,`"@!2`````````I0`````````````__\`````````/`!CG
- XM``H`5@````````*H`````%$``````/__```$Q```````6P`*`%8````````">
- XMO`````!:``````#__P``!.8````*`%L`"@!6`````````M``````6```````M
- XM__\```4(````%`!;``H`5@````````+D`````$,``````/__```%*@```!X`.
- XM6P`*`%8````````"^`````!6``````#__P`````````H`%L`"@!"````````8
- XM`PP`````````````__\```5N``````"#``H`4@````````,@````````````"
- XM`/__```%D`````H`@P`*`5L````````#-`````````````#__P``!;(````4&
- XM`(,`"@%3`````````T@`````````````__\`````````'@"#``H`4P``````H
- XM``-<`````````````/__```%\@``````8P`*``$```8&```#M```````````%
- XM```&$`!P````6P`*``$```7F```$H@````````````````#8````@P`*``$`C
- XM``7````%3``````````````%U$YQ0T]..C,P+S,P+S(P,"\Q-3`O5V]R:V)E<
- XM;F-H````!E````90``````````$P,3(S-#4V-S@Y04)#1$5&``!.<0``````'
- XM```````````````````````````4`````$YQ```&L```````````````````)
- XM````````````````!LP```````````````````````````````````;H`````
- XM`````````````````````````````````````````````````````````````
- XM`````````^P````L`````@``!I0```:P```&S```!E````94```#<````X(`G
- XM``.D```#M````\8```/6```#Z````_@```0*```$&@``!"P```0\```$3@``4
- XM!%@```1>```$<```!)(```2B```$M```!,0```36```$Y@``!/@```4(```%`
- XM&@``!3P```5,```%7@``!6X```6````%D```!:(```7$```%U```!>8```7R'
- XM```&!```!B(```8N````%P````,```(4```"*````CP```)0```"9````G@`P
- XM``*,```"H````K0```+(```"W````O````,$```#&````RP```-````#5```K
- XM`V@```7B```&````!AX```'0```!\@````````/R```#Z0``!K\CSP```"@CC
- XMP````#`CR````#0L>``$(\X````$D\E.KO[:*$!*K`"L9P`!"&$``A"1R"`LN
- XM`*SEB"`P"!#EB$CG`#!%^0```+A'^0```#@@0'``$!A",`@`)L@@.0```#`@$
- XM>0```#1#\`@`#"$`(%+(__I"*0`!$AAG7`P!`"!G]@P!``EG\";*#`$`(F<4R
- XM%,$2&&="#`$`(&<$%,%@\D(:8-02&&<P#`$`(F?R#`$`*F8@$A@,`0!.9P8,[
- XM`0!N9@1R"F`.#`$`16<`$`968"<AL4P6#,0A)"DR`\````-)"+1H#DB$S?;
- XM#`!(>0```#@O`$ZY`````"/`````$"/`````'$ZY`````"/`````%"/`````.
- XM&"/`````("/`````)$ZY```&K'``+GD````H3G5A``$*80``]"/`````+"\`<
- XM0J<D0"`J`"1G#BQY````""!`(A!.KO^"0?D```8T#!```&=0(@@D/````^TL9
- XM>0````A.KO_B#(``````9T0CP````!`CP````!0CP````!@CP````!PCP```<
- XM`"`CP````"0I0`"<*4``H.6(($`I:``(`*1.N0``!JQP`&`$("\`!$JY````B
- XM+&<2(CD````0:PHL>0````A.KO_<+GD````H+P`L>``$(#D````(9P8B0$ZN;
- XM_F)*N0```"QG#DZN_WPB>0```"Q.KOZ&(!].=4CG`08N/``#@`<L>``$3J[_1
- XME$S?8(!P9&"80>P`7$ZN_H!![`!<3J[^C$YU0_H`$G``3J[]V"/`````"&?"D
- XM3G5D;W,N;&EB<F%R>0!.<4Y5__9(YQP`<``H`$ZY```#^G`!('D```'`(&@`]
- XM5A(H``]T`!0!(@+CH"8`2H1F(B\#3KD`````6$\J`,"#9Q`O.0```<!.N0``_
- XM`L183R@`8-I"ITZY```$K%A/3-\`.$Y=3G5.5?_D2.<?.$7Y```)3'``+`!P2
- XM`"@`(&T`""\H`%9.N0````!83R@`9P`!`B!$*V@`%/_P($0[:``8__PO!$ZYX
- XM`````%A/<``@+?_P3KD``!K"```#+@```@````,V```!``````````/L<`$LO
- XM`&```+AP`#`M__Q(P"8`#(/_____9P``H"`#`H`````?*$`@`^J``H`````_:
- XM)D!P"R(#X*$"@0```!\J`2\#+SD```8N3KD`````4$\@0#`H``Q(P"X`+PLOK
- XM#$AY```%5DZ2WOP`#`R%````'V<,+P5(>0``!4A.DE!/(`<"@````0!G"DAYN
- XM```%/$Z26$](>0``!3I.DEA/+P,O.0``!BY.N0````!03R!`,"@`($C`)@!@I
- XM`/]:8````F``_NP@!DS?'/A.74YU3E4``$CG`#!%^0```<!'^0``!*Q(>``AJ
- XM2'D```4H3KD`````4$\CP````;@@.0```;AF"$AX``5.DUA/2'@`(4AY```%D
- XM%DZY`````%!/(\````&\(#D```&\9@A(>``%3I-83TAY```!V$ZY`````%A/U
- XM)(`@$F8(2'@`!4Z36$]"IT*G2'D```'$(%(O*``R3KD`````WOP`$"\Y```
- XM+B\23KD`````4$],WPP`3EU.=4Y5```O"D7Y```!P"`29QP@4B`H`!QG"B\22
- XM3KD`````6$\O$DZY`````%A/(#D```&\9PXO.0```;Q.N0````!83R`Y```!5
- XMN&<.+SD```&X3KD`````6$\O+0`(3KD```FL6$\D7TY=3G5G<F%P:&EC<RYL?
- XM:6)R87)Y``!I;G1U:71I;VXN;&EB<F%R>0`*`"`H0VAE8VME9"D@`"P@<W5BG
- XM:71E;2`E9```4V5L96-T960@;65N=2`E9"P@:71E;2`E9`!497-T365N=2!6.
- XM,2XP("@Q,BUO8W0M.3`I("T@8GD@2&%N<R!*86YS96X``$%C=&EV871E($UE@
- XM;G5)=&5M(&]R($-L;W-E1V%D9V5T``!.<2!0<F5F97)E;F-E<R`@("`@("`@F
- XM("`@("`@("`@("`@("`@("``("!%9&ET("`@("`@("`@("`@("`@("`@("`@&
- XM("`@(``@4')O:F5C="`@("`@("`@("`@("`@("`@("`@("`@("``16%T($ET.
- XM(%1O;P``2&%V92!9;W5R($-A:V4``$%U=&\@4V%V90!3;W5N9`!%<F%S92!!;
- XM;&P`4&%S=&4`0V]P>0``0W5T`%5N9&\``%%U:70``$%B;W5T+BXN``!$<F%F7
- XM=`!.3%$`4')I;G0`4V%V94%S``!3879E``!/<&5N``!.97<`3E4``$CG`#!%!
- XM^0``!HY'^0``!^1P%#/````&C$AX`*!.N0``#C!83R2`(!)F'$*G2'D``0``0
- XM3KD`````4$](>``!3KD```'`6$\P/!``2,`@4B%```0@4B"Y````$$AY```'4
- XMK$*G3I-03R/`````+#`\$`%(P"!2(4``#"!2(7D````4``A(>0``!ZI(>``!C
- XM3I-03R/`````,"!2("@`"&<V2'@#[4AY```'J$ZY`````%!/(%(A0``0(%(`-
- XMJ`````$`%$AY```'IDAX``).DU!/(\`````T+RT`#"\M``A.N0```F!03T*G!
- XM3KD```FL6$],WPP`3EU.=7<`*@!W`'(`3G%.50``2'@`!$AY```'X$ZY````G
- XM`"\`3KD`````WOP`#$AX``%.N0``":Q83TY=3G5>0PH`3E7__"\#3KD```K*$
- XM)@!F""`#)A].74YU($,A;0`(``1P`7(`$@`@`2!#,4``&B\#3KD``!`(6$]*M
- XM@&<(($,`:``@`!H@`V#*3E7__$CG&``F+0`(<``H`$J#9@IP_TS?`!A.74YUV
- XM($,P*``:9U8@0S`H`!IR`#(`(`$"@`````)G$$AX__\O`TZY```,P%!/*``@1
- XM0R\H``1.N0``$CQ83XB`($,P*``:<@`R`"`!`H`````09PX@0R\H`!1.N0``8
- XM#K)83W``($,A0``4<``@0R%```AP`"!#(4``#'``<@`2`"`!($,Q0``:(`1@R
- XM`/]P3E4``$AX__\O+0`(3KD```S`4$].74YU3E4``"\Y`````"\M``A.N0``*
- XM"AA03TY=3G5.50``+P,F+0`(('D````$4KD````$$(,@`R8?3EU.=4Y5```CZ
- XM[0`(`````$AM`!`O+0`,2'K_L$ZY```4IM[\``Q.74YU3E4``"/Y````,```7
- XM``!(;0`,+RT`"$AZ_XA.N0``%*;>_``,3EU.=4Y5__PO`R/M``@````$2&T`D
- XM$"\M``Q(>O]Z3KD``!2FWOP`#"8`('D````$0A`@`R8?3EU.=4YQ3E7__"\#4
- XM(#D````D9P@@>0```"1.D"`Y```&CF<L<``F`#`Y```&C$C`MH!L#B\#3KD`)
- XM`!(\6$]2@V#F+SD```:.3KD```ZR6$\@.0```"AG""!Y````*$Z0+RT`"$ZYT
- XM```!P%A/)A].74YU3E7_^DCG'``F+0`,*"T`"!M$__\@0R`H``@@0["H``QM"
- XM%"\$+P-.N0``#,!03TS?`#A.74YU(D,@:0`(4JD`"!"$($,P*``:<@`R`"`!C
- XM`H`````@9R@,A`````IG"`R$````#688+P0O`TZY```,P%!/*@`@0U.H``@@<
- XM!6"P(`1@K$YQ3E7_^$CG&`!!^0``!I0F"$J#9Q(@0R@0+P-.N0``""Q83R8$&
- XM8.I,WP`83EU.=4Y5__A(YQ@`(#D````D9@I!^O_`(\@````D0?D```:4)@A*>
- XM@V<2*`,@0S`H`!IF`F`&($,F$J2H-F)$AX`!Q.N0``#C!83R8`9@IP`$S?]
- XM`!A.74YU($0@@W``($,@@'``($,A0``(<``@0R%```QP`"!#(4``%'``<@`2X
- XM`"`!($,Q0``:(`-@Q$Y5__PO`R8M``A(>`0`3KD```XP6$\@0R%``!0@*``4E
- XM9A@@`P:`````&"!#(4``%'`!($,A0``08!0@0P!H`!``&C`\!`!(P"!#(4``!
- XM$"!#+R@`!$ZY```0"%A/2H!G""!#`&@`(``:)A].74YU3E7_^$CG'``F+0`(%
- XM($,P*``:<@`R`"`!`H`````,9PIP_TS?`#A.74YU($,":/_]`!H@0R`H`!1FA
- XM""\#3KK_5%A/($,P*``:<@`R`"`!`H````"`9SI!^0``!I0H"$J$9RX@0S`H;
- XM`!IR`#(`(`$"@````((,@````()F#DAX__\O!$ZY```,P%!/($0H$.($,OD
- XM*``0($,O*``4($,O*``$3KD``!!DWOP`#"H`;S(@0R)#(V@`%``(($,@*``4>
- XMT(4@0R%```PB0R!I``A2J0`($!!(@$C``H````#_8`#_0DJ%;`H@0P!H``@`(
- XM&F`(($,`:``$`!IP_V``_R9.5?_Z2.<<`"8M``@H+0`,&T3_^R!#,"@`&G(`B
- XM,@`@`0*`````"&<*</],WP`X3EU.=2!#,"@`&G(`,@`@`0*``````F<N($,@$
- XM*``(($.0J``4*@`O!2!#+R@`%"!#+R@`!$ZY```1!-[\``RPA6<$8```H@R$]
- XM_____V8<($,":/_]`!IP`"!#(4``"'``($,A0``,<`!@DB!#("@`%&8(+P-.L
- XMNOWP6$\@0R`H`!`,@`````%F*$AX``%(;?_[($,O*``$3KD``!$$WOP`#`R`@
- XM`````6<"8#P@!&``_TX@0R)#(V@`%``(($,@*``4($/0J``0($,A0``,($,`C
- XM:``"`!HB0R!I``A2J0`($(0@!&``_Q@@0P!H``@`&G``($,A0``(<``@0R%`)
- XM``QP_V``_OI.<4Y5__A(YQ@`0?D```90)B@`!`R#```&4&<:($,H*``$($,O$
- XM*``(+P-.N0````!03R8$8-Y,WP`83EU.=4Y5__A(YQP`*BT`"&8*</],WP`XG
- XM3EU.=2`%!H`````,*`!(>0`!```O!$ZY`````%!/)@!F!'``8-9!^0``!E`@.
- XM:``$((-!^0``!E`B0R-H``0`!$'Y```&4"%#``1!^0``!E`B0R*(($,A1``(^
- XM0?K_5"/(````*`:#````#"`#8(Y.5?_T2.<<`"`M``@$@`````PF`"!#*"@`F
- XM!"!#*A`@1"`0L(-G"$S?`#A.74YU($,O*``(+P-.N0````!03R!$((4@12%$5
- XM``1@W$Y5__A(YQ@`+RT`#"\M``A.N0``%]0@'UA/*``O!$ZZ_Q183R8`+P0OJ
- XM`TZY```/O%!/(`-,WP`83EU.=4Y5__1(YQ\`)BT`#"XM``@@!P2`````#"@`-
- XM($0L*``$($8@$+"$9PIP`$S?`/A.74YU+P-.NO["6$\J`"!$MJ@`"&,(($0@\
- XM*``(8`(@`R8`+P,O!2\'3KD```^<WOP`#"`%8,9.50``+RT`$"\M``@O+0`,U
- XM3KD``!&8WOP`#$Y=3G5.<4Y5```O+0`,0J<O+0`(3KD```_8WOP`#$Y=3G5.K
- XM5?_V2.<>`"HM``@L!2@M``PF+0`02H-O"B!&4H80A%.#8/(@!4S?`'A.74YUA
- XM3G%.5?_\2.<8`"8M``@@.0``!HXB`^>!T($H`'``L(-N$C`Y```&C$C`MH!N\
- XM!B!$(!!F$G`#(\````:(</],WP`83EU.=2!$+Q!.N0````!83TJ`9P1P`6`"O
- XM0H!@X$Y5__A(YQP@*"T`"$7Y```&B$ZY```2""`Y```&CB($YX'0@28`<`"PC
- XMA&X2,#D```:,2,"X@&P&($,@$&8.<`,D@'#_3-\$.$Y=3G4@0R`H``0"@```$
- XM``,,@`````%F"'`")(!P_V#<+RT`$"\M``P@0R\03KD`````WOP`#"H`#(7_<
- XM____9@Q.N0`````D@'#_8+!.N0``$@@@!6"F3G%.5?_X2.<<("@M``A%^0``$
- XM!HA.N0``$@@@.0``!HXB!.>!T($F`'``L(1N$C`Y```&C$C`N(!L!B!#(!!FK
- XM#G`#)(!P_TS?!#A.74YU($,@*``$`H`````#9@AP`B2`</]@XB\M`!`O+0`,F
- XM($,O$$ZY`````-[\``PJ``R%_____V8,3KD`````)(!P_V"V(`5@LDYQ3E7_`
- XM]$CG'P`L+0`0+BT`"$J&;@H@!TS?`/A.74YU*BT`#"@'NH1N,"`&4X`B!=*`N
- XM(`&PA&TB(`93@-J`(`93@-B`)@9*@V\.($53A2)$4X02D%.#8.Y@%"8&2H-O:
- XM#B!%4H4B1%*$$I!3@V#N(`=@IDY5__PO`TAX,`!"ITZY`````%!/)@`"@```P
- XM,`!G#B`Y```&7&<&3KD```>P(`,F'TY=3G5.5?_\2.<8`"@M``@@.0``!HXBR
- XM!.>!T($F`'``L(1N$C`Y```&C$C`N(!L!B!#(!!F$G`#(\````:(</],WP`85
- XM3EU.=2!#("@`!`*````0`&8,($,O$$ZY`````%A/<``@0R%```1P`"!#((!P,
- XM`,3E7_]$CG'R`H+0`,+BT`"$7Y````"`R$@````&9:<``@$DZY```:P@``/
- XM$O0````(```2_@````H``!,(````$````````!,20?D``!?()@A@'$'Y```7,
- XMO"8(8!)!^0``%[(F"&`(0?D``!>J)@@@`TS?!/A.74YU<``@$@R`````"F8(\
- XM2H1L!'`!8`)"@"P`9P8@!$2`*``J!"`'!H````0`)@!3@R!#0A!!^0``!F`O;
- XM$B\%3KD``!IT(!]83]'`4X,B0Q*0+Q(O!4ZY```9,BH?6$]*A6<((`=2@+:`3
- XM;LI*AF<(4X,@0Q"\`"T@`V"`3E7_\$CG'S`N+0`(1?D````@1_D````0<`$FD
- XM`"\'3KD``!K46$\J`+J3;P(J$R`Y````&&=T(#D````4#(`````@9Q(@1Q`0<
- XM2(!(P"@`#(0````M9P@,A````"MF("\$(%).D%A/#(#_____9@IP_TS?#/A.S
- XM74YU4H-2AU.%4[D````,(#D````,L(5M'"\Y````%"!23I!83PR`_____V8$&
- XM</]@RE*#8-1P`"P`O)-L)B!'4H<0$$B`2,`H`&<8+P0@4DZ06$\,@/____]F.
- XM!'#_8)Q2AF#6UH:VN0````QL'$AX`"`@4DZ06$\,@/____]F!G#_8`#_>%*#"
- XM8-S7N0```!P@`V``_VA.5?OL2.<?."@M``Q%^0```!!)^0````PC[0`(````W
- XM("HM`!!P`"/`````'"!$$!!(@$C`)@!G``+(#(,````E9R8O`R!M``A.D%A/N
- XM#(#_____9@IP_TS?'/A.74YU4H12N0```!Q@Q%*$($00$$B`2,`F``R#````4
- XM)68@+P,@;0`(3I!83PR`_____V8$</]@Q%*$4KD````<8)!P`2/`````&'`$)
- XM+@!P`"2`*))P("/`````%`R#````+684<``CP````!A2A"!$$!!(@$C`)@`,`
- XM@P```#!F%'`P(\`````44H0@1!`02(!(P"8`#(,````J9A0@15B%*)!2A"!$[
- XM$!!(@$C`)@!@,G``<#"P@VXJ#(,````Y8B(@%-"`(@#E@="!T(,$@````##1$
- XME%*$($00$$B`2,`F`.#(,````N9EI2A"!$$!!(@$C`)@`,@P```"IF%"!%W
- XM6(4DD%*$($00$$B`2,`F`&`R<`!P,+"#;BH,@P```#EB(B`2T(`B`.6!T('0%
- XM@P2`````,-&24H0@1!`02(!(P"8`8,X,@P```&QG"`R#````3&82<`0N`%*$-
- XM($00$$B`2,`F`&`@#(,```!H9P@,@P```$AF$'`"+@!2A"!$$!!(@$C`)@`@]
- XM$@R````#_FP$(!)F"#`\`_Y(P"2`<`!R`!(`(`$CP`````A2A'``(`-.N0``X
- XM&L(``!;F````>```%NP```!O```6\@```&0``!=*````<P``%W@```!C````S
- XM````%WY0N0````A0N0````AP`"`Y````"&8.<`IR`!(`(`$CP`````@,AP``9
- XM``1F""!%6(4F4&`*($54A3`02,`F0"\+2&W[[$ZZ^X!03RP`+P9.NOQF6$\,V
- XM@/____]F!G#_8`#]MF!8($58A2P0(!1G!"248`@P/'_-2,`D@"\&3KK\.%A/;
- XM#(#_____9@9P_V``_8A@*B!%6(4F$!M#^^Q![?OL0B@``4AM^^Q.NOP,6$\,N
- XM@/____]F!G#_8`#]7&``_2Y@`/U4+4]/4%,M```X,#`P,#`P,```+3(Q-#<T>
- XM.#,V-#@`,C`P,#`P,#`P,#``3E8``$CG^`!*;@`(9AI*;@`,9A0P+@`*P.X`^
- XM#BU```A,WP`?3EY.=7@!)"X`"&P$1()$A"8N``QL!$2#1(1"@#`"P,,R`DA"A
- XMQ,-(0\+#TH)(04)!T(%*A&P"1(`M0``(3-\`'TY>3G5.5@``2.?P`$IN``AG@
- XM+DIN``QF)"0N``@F+@`,0H`P`L##,@)(0L3#2$/"P]*"2$%*068$T(%D$G#_*
- XM8`Y*;@`,9M(P+@`*P.X`#BU```A,WP`/3EY.=4Y6```O`$IN``QF'"`N``AK&
- XM%H#N``YI$`*```#__RU```@@'TY>3G5(YWP`>@$@+@`(;`1$@$2%)@`B+@`,I
- XM;`1$@42%*`$,@0`!``!L%$)`2$"`P30`,`.`P4A`,`)(0&`JXHCBB0R!``$`7
- XM`&ST@,$"@```__\D`"\`+P1A`/[$(!]83[:`;`)3@B`"2H5L`D2`+4``"$S?L
- XM`#X@'TY>3G5.5@``+P`@+@`(2FX`#&8\@.X`#FD0`H```/__+4``""`?3EY.>
- XM=4CG8``R+@`.=`!(0#0`A,$]0@`(2$(P`DA`@,$]0``*3-\`!F#42.=\`"(N:
- XM``RP@6X*9P1P`&!"<`%@/BH`)@'BB.*)#($``0``;/2`P0*```#__R0`+P,O;
- XM`F$`_H@@'UA/L(5G$FT$4X)@ZB@%F("X@V\$4H)@WB`"+4``"$S?`#Y@`/]VG
- XM3E8``$CG^`!*;@`,9AP@+@`(:Q:`[@`.:1!"0$A`+4``"$S?`!].7DYU>`$@N
- XM+@`(;`1$@$2$)``B+@`,;`)$@0R!``$``&P00D!(0(#!,`*`P4)`2$!@+"8!J
- XMXHCBB0R!``$``&ST@,$"@```__\O`"\#80#]@B`?6$^T@&0"D(.0@D2`2H1LH
- XM`D2`+4``"$S?`!].7DYU3E8``$CG\``@+@`(2FX`#&86@.X`#FD00D!(0"U`Y
- XM``A,WP`/3EY.=28N``PD`"\#+P!A`/Z*+P-A`/V.(A]03Y2!+4(`"$S?``].1
- XM7DYU(%\B6"()9P:PF&;V3M$@4$[03E7_^$CG&`!P`"8`*"T`""!$4H00$&<$<
- XM4H-@]"`#3-\`&$Y=3G5.<0```^P````K`````0``$KX``!.J```3L```$\P`&
- XM`!/4```4'```%"(``!0L```4>```%)P``!2T```4N@``%,(``!3.```5"```T
- XM%3P``!5&```56```%6@``!6$```6I@``%N@``!;N```6]@``%P8```ZD```*2
- XMU```"N````GX```*````";0```F\```)4@``"/(```D2```)&```"2X```E6R
- XM```)?@``"9P```>````'0@``!Q@```!2`````@``$U@``!)R```27@``$DH`J
- XM`!(H```1,@``$1X``!$2```0D@``$'X``!!R```0/@``$"H``!`6```-_@``Z
- XM#@@```YL```.>```#H8```Z0```*I@``"N8```P:```)T```"<0```GJ```'N
- XM+```!P8```;$```&M@```W(```/.```$E@```G8```*B```$!```!"(```0H5
- XM```$2@``!%````1@```$@```!+0```3:```$X@``!/````3X```!7`````(`5
- XM```(````#@```!@```!$````2@```%P```!B````W````.P```#Z```!````]
- XM`0P```$2```!&````1X```$L```!/````4X```%P```!@@```8@```&.```!>
- XME````9H```&@```!Q@```<X```'6```!X````>P```'Z```"!@```DH```!0J
- XM`````P``$[P``!-X```38@``$M```!:R```2U```$MP``!+D```2\```$O8`0
- XM`!,````3"@``$Q0``!:V```6O@``%L8``!;.```6U@``%N(``!(P```1&```&
- XM$'@``!#Z```/S```#ZX```^0```/*```#PX```TD```-A@``#&8```NJ```+3
- XM#```"V0```JX```,1@``"D````J$```*#```"?````G>```)0```"6@```F0P
- XM```(_```"*(```A^```(;@``".(```@6```'[```!]8```>Z```'F```!XX`W
- XM``;P```&S@``!KP```<,```'-```!U0```=R```%"@```Q(```+.```";@``2
- XM`J@```*V```#%@```QX```,J```#C@```Z0```.X```#P@``!`H```04```$K
- XM/````20```&X`````0````0```=:`````0````4``!*4`````0````8``!#:=
- XM`````@````<``!%T```'R`````$````(````]`````(````)```'P````08`S
- XM```"````"@``$8@``!#N`````0````L``!!2`````0````P```;D`````0``)
- XM``T```Y<`````@````X```X>```.Z@````$````/```2%@````$````0```"V
- XME`````$````1```"Y`````$````2```#!`````(````3```$Z```!/X````"K
- XM````%```!!H```1"`````0```!4```3(`````0```!8```32`````@```!<`@
- XM``-X```#U`````$````8```$9@````$````9```$C`````$````:```$G@``\
- XM``````/R```#Z0````=(YR`"3.\`!@`,+'D````(3J[_XDS?0`1.=4YQ```#$
- XM[`````$````"````#`````````/R```#Z0````4O#B(O``@L>0````A.KO_<[
- XM+%].=0```^P````!`````@````@````````#\@```^D````'2.<P`DSO``X`:
- XM$"QY````"$ZN_]9,WT`,3G5.<0```^P````!`````@````P````````#\@``Z
- XM`^D````'2.<P`DSO``X`$"QY````"$ZN_]!,WT`,3G5.<0```^P````!````.
- XM`@````P````````#\@```^D````$+PXL>0````A.KO_*+%].=0```^P````!@
- XM`````@````0````````#\@```^D````$+PXL>0````A.KO_$+%].=0```^P`1
- XM```!`````@````0````````#\@```^D````$+PXL>0````A.KO]\+%].=0``;
- XM`^P````!`````@````0````````#\@```^D````%+PXB+P`(+'D````(3J[_:
- XM*"Q?3G4```/L`````0````(````(`````````_(```/I````!TCG`08N+P`0[
- XM*F\`%"QY````!$ZN_Y1,WV"`3G4```/L`````0````(````.`````````_(`H
- XM``/I````!B\.3.\``P`(+'D````$3J[_.BQ?3G5.<0```^P````!`````@``2
- XM``H````````#\@```^D````&+PXB;P`(("\`#"QY````!$ZN_RXL7TYU```#%
- XM[`````$````"````#`````````/R```#Z0````8O#DSO``,`""QY````!$ZN*
- XM_LXL7TYU3G$```/L`````0````(````*`````````_(```/I````!2\.("\`'
- XM""QY````!$ZN_L(L7TYU```#[`````$````"````"`````````/R```#Z0``6
- XM``4O#B!O``@L>0````1.KOZ,+%].=0```^P````!`````@````@````````#3
- XM\@```^D````%+PXB;P`(+'D````$3J[^ABQ?3G4```/L`````0````(````(J
- XM`````````_(```/I````!2\.(F\`""QY````!$ZN_F(L7TYU```#[`````$`_
- XM```"````"`````````/R```#Z0````8O#B)O``@@+P`,+'D````$3J[]V"Q?G
- XM3G4```/L`````0````(````,`````````_(```/I````!2\.(&\`""QY```!A
- XMN$ZN_\HL7TYU```#[`````$````"````"`````````/R```#Z0````4O#B!OW
- XM``@L>0```;A.KO^X+%].=0```^P````!`````@````@````````#\@```^D`"
- XM```&+PX@;P`(("\`#"QY```!N$ZN_W`L7TYU```#[`````$````"````#```*
- XM``````/R```#Z0````4O#B!O``@L>0```;A.KO\T+%].=0```^P````!````%
- XM`@````@````````#\@```^D````'+PY,[P,```A,[P`#`!`L>0```;A.KO\H$
- XM+%].=0```^P````!`````@```!`````````#\@```^D````&+PY,[P,```@LF
- XG>0```;A.KO[X+%].=4YQ```#[`````$````"````"@````````/RB
- X``
- Xend
- Xsize 11604
- END_OF_FILE
- if test 16283 -ne `wc -c <'TestMenu.uu'`; then
- echo shar: \"'TestMenu.uu'\" unpacked with wrong size!
- fi
- # end of 'TestMenu.uu'
- fi
- if test -f 'makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'makefile'\"
- else
- echo shar: Extracting \"'makefile'\" \(339 characters\)
- sed "s/^X//" >'makefile' <<'END_OF_FILE'
- X# Makefile for MakeMenu using PDC
- X
- XCC = ccx
- XCFLAGS = -c
- X
- X.c.o:
- X $(CC) $(CFLAGS) $*.c
- X
- Xall : MakeMenu TestMenu
- X TestMenu
- X
- XBOBJS = makemenu.o
- X
- XMakeMenu : $(BOBJS)
- X $(CC) -o MakeMenu $(BOBJS)
- X
- XTOBJS = testmenu.o menu.o
- X
- XTestMenu : $(TOBJS)
- X $(CC) -o TestMenu $(TOBJS)
- X
- Xmenu.o : menu.c
- X
- Xmenu.c : menu.test MakeMenu
- X MakeMenu menu.test menu.c
- END_OF_FILE
- if test 339 -ne `wc -c <'makefile'`; then
- echo shar: \"'makefile'\" unpacked with wrong size!
- fi
- chmod +x 'makefile'
- # end of 'makefile'
- fi
- if test -f 'makemenu.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'makemenu.c'\"
- else
- echo shar: Extracting \"'makemenu.c'\" \(14632 characters\)
- sed "s/^X//" >'makemenu.c' <<'END_OF_FILE'
- X/* MakeMenu V1.0 (14-oct-90) - by Hans Jansen
- X *
- X * This program will generate C source to build Intuition menus, from
- X * a simple description file. See MakeMenu.Doc for details on usage.
- X *
- X */
- X
- X#define DISABLE 0
- X#define DEFAULT 1
- X#define ENABLE 1
- X#define TOGGLE 2
- X#define CHECK 4
- X#define SELECT 8
- X
- X#define CHAR_WIDTH 8
- X
- X#include <intuition/intuition.h>
- X#include <stdio.h>
- X
- X#define NO_ERROR 0
- X#define ERROR_NO_COMMA 1
- X#define ERROR_BAD_TEXT 2
- X#define ERROR_NO_MENU 3
- X#define ERROR_NO_ITEM 4
- X#define ERROR_NO_DATA 5
- X#define ERROR_BAD_NUMBER 6
- X#define ERROR_BAD_COMMAND 7
- X#define MAX_LINE 132
- X
- Xchar cline[MAX_LINE]; /* input line */
- Xchar RecBuf[BUFSIZ]; /* input buffer */
- Xchar *ifname, *ofname; /* File name pointers */
- XFILE *ofile; /* output file handle */
- Xint EndOfFile; /* true = end of file */
- Xint lcnt; /* current input line count */
- X
- Xstruct IntuiText *CText; /* Current Text Item pointer */
- Xstruct IntuiText *AllText; /* All text items */
- Xstruct MenuItem *CItem; /* Current Menu Item */
- Xstruct MenuItem *CSItem; /* Current Sub Menu Item */
- Xstruct Menu *CMenu, *AllMenu; /* Menu pointers */
- X
- Xmain (argc, argv)
- X int argc; /*number of arguments */
- X char *argv[]; /*array of ptrs to arg strings */
- X
- X{
- X FILE *ifile; /* input File pointer */
- X int i, j;
- X int result, error;
- X char *Scan();
- X int GetLine();
- X char *cptr;
- X char etype[5];
- X
- X/* get the file names and open the files */
- X/* initialize input buffers and variables */
- X
- X AllText = NULL;
- X CText = NULL;
- X CMenu = NULL;
- X CItem = NULL;
- X CSItem = NULL;
- X AllMenu = NULL;
- X result = NO_ERROR;
- X error = 0;
- X lcnt = 0;
- X
- X if (argc != 3)
- X printf ("usage: MakeMenu <inputfile> <outputfile>\n");
- X
- X for (ifname = NULL, i=1; i<argc && ifname == NULL; i++)
- X if ( *argv[i] != '-') ifname = argv[i];
- X
- X for (ofname = NULL, i=i; i<argc && ofname == NULL; i++)
- X if ( *argv[i] != '-') ofname = argv[i];
- X
- X EndOfFile = FALSE; /* no end of file */
- X ifile = fopen (ifname, "r"); /* open file for reading */
- X if (ifile == NULL) {
- X printf (" Cannot open file %s for input!\n", ifname);
- X exit (10);
- X };
- X
- X while ((j = GetLine (ifile, cline, sizeof (cline))) > 0) {
- X cptr = &cline[0];
- X for (i = 0; i < sizeof (etype) -1; i++)
- X etype[i] = toupper (*(cptr + i));
- X etype[i] = '\0';
- X cptr = Scan (cptr, ',', TRUE);
- X if (strcmp ("MENU", etype) == 0)
- X result = Process_Menu (cptr); /* do a Menu */
- X else if (strcmp ("ITEM", etype) == 0)
- X result = Process_Item (cptr, 0); /* do an Item */
- X else if (strcmp ("SUBI", etype) == 0)
- X result = Process_Item (cptr, 1); /* do a SubItem */
- X else
- X result = ERROR_BAD_COMMAND;
- X if (result != NO_ERROR) {
- X error++;
- X printf (" Line %d has syntax error:%s\n", lcnt, cline);
- X };
- X };
- X fclose (ifile);
- X if (error == 0) Do_Output ();
- X}
- X
- Xchar *Scan (ptr, c, control)
- X char *ptr;
- X char c;
- X int control;
- X
- X{
- X while (*ptr != NULL && ((control && *ptr != c) || (! control && *ptr == c)))
- X ptr++;
- X return (ptr); /* return the new pointer */
- X}
- X
- XGetLine (fptr, line, lsize) /* get a line from buffer */
- X FILE *fptr; /* pointer to file to read from */
- X char line[]; /* destination of characters */
- X int lsize; /* maximum size for destination */
- X
- X{
- X lcnt++; /* bump line count */
- X
- X if (fgets (line, lsize, fptr) == NULL) {
- X EndOfFile = TRUE;
- X return (0);
- X }
- X else {
- X line[strlen (line) - 1] = '\0'; /* discard newline character */
- X return (strlen (line));
- X }
- X}
- X
- Xint Process_Menu (ptr)
- X char *ptr;
- X
- X{
- X char *tptr;
- X int len;
- X struct Menu *last;
- X
- X if (AllMenu == NULL) { /* first menu item */
- X AllMenu = (struct Menu *) malloc (sizeof (struct Menu));
- X CMenu = AllMenu; /* Set current pointer */
- X }
- X else { /* add new one to list */
- X last = CMenu;
- X CMenu = (struct Menu *) malloc (sizeof(struct Menu));
- X last->NextMenu = CMenu;
- X };
- X
- X/* Build Menu structure */
- X
- X if (*ptr != ',') return (ERROR_NO_COMMA);
- X ptr++;
- X
- X/* process disable-flag, if any */
- X
- X if (*ptr == 'D' || *ptr == 'd')
- X CMenu->Flags = DISABLE;
- X else
- X CMenu->Flags = ENABLE;
- X ptr = Scan (ptr, ',', TRUE);
- X if (*ptr != ',') return (ERROR_NO_COMMA);
- X ptr++;
- X
- X tptr = Scan (ptr, '\0', TRUE); /* find end of string */
- X len = tptr-ptr;
- X CMenu->MenuName = (BYTE *) malloc (len+1);
- X strcpy (CMenu->MenuName, ptr);
- X CMenu->NextMenu = NULL;
- X CMenu->FirstItem = NULL;
- X CItem = NULL;
- X CMenu->Width = len + 3 ;
- X return (NO_ERROR);
- X}
- X
- Xint Process_Item (ptr, type)
- X char *ptr;
- X int type; /* 0 = Item, 1 = SubItem */
- X
- X{
- X struct IntuiText *Process_Text();
- X struct MenuItem *ThisItem;
- X struct MenuItem *lastI;
- X struct MenuItem *lastSI;
- X
- X if (CMenu == NULL) return(ERROR_NO_MENU);
- X if (type == 1 && CItem == NULL) return(ERROR_NO_ITEM);
- X if (*ptr != ',') return(ERROR_NO_COMMA);
- X
- X if (type == 0) { /* Build a MenuItem */
- X lastI = CItem;
- X CSItem = NULL; /* clear current Sub Item Flag */
- X CItem = (struct MenuItem *) malloc (sizeof (struct MenuItem));
- X
- X if (lastI == NULL) /* First Item for Menu */
- X CMenu->FirstItem = CItem; /* link it to the menu */
- X else
- X lastI->NextItem = CItem; /* link it to the item list */
- X ThisItem = CItem; /* build it */
- X }
- X else { /* Build a SubItem */
- X lastSI = CSItem;
- X CSItem = (struct MenuItem *) malloc (sizeof (struct MenuItem));
- X if (lastSI == NULL) /* First Sub Item for Menu Item */
- X CItem->SubItem = CSItem; /* link in the sub items */
- X else
- X lastSI->NextItem = CSItem;
- X ThisItem = CSItem;
- X };
- X
- X/* Process flags, name, select and command */
- X
- X ptr++;
- X ThisItem->Flags = ENABLE;
- X while (*ptr != ',') {
- X if (*ptr == 'D' || *ptr == 'd') ThisItem->Flags &= ~ENABLE;
- X else if (*ptr == 'T' || *ptr == 't') ThisItem->Flags |= TOGGLE;
- X else if (*ptr == 'C' || *ptr == 'c') ThisItem->Flags |= CHECK;
- X else if (*ptr == 'S' || *ptr == 's') ThisItem->Flags |= SELECT;
- X ptr++;
- X }
- X
- X ptr++;
- X
- X ThisItem->ItemFill = (APTR) Process_Text (ptr);
- X if (ThisItem->ItemFill == NULL) return (ERROR_BAD_TEXT);
- X
- X ptr = Scan (ptr, ',', TRUE); /* find next comma */
- X if (*ptr != ',') return (ERROR_NO_COMMA);
- X ptr++;
- X
- X/* Select name? */
- X
- X ThisItem->SelectFill = (APTR) Process_Text (ptr);
- X
- X ptr = Scan (ptr, ',', TRUE); /* find next comma */
- X if (*ptr != ',') return (ERROR_NO_COMMA);
- X ptr++;
- X
- X/* Command ? */
- X ThisItem->NextItem = NULL;
- X ThisItem->SubItem = NULL;
- X ThisItem->Command = *ptr;
- X ThisItem->MutualExclude = 0L;
- X return (NO_ERROR);
- X}
- X
- Xstruct IntuiText *Process_Text (ptr)
- X char *ptr;
- X{
- X
- X struct IntuiText *dptr, *lasText;
- X char *tptr;
- X
- X if (*ptr == ',') return (NULL);
- X
- X lasText = AllText;
- X while (lasText != NULL) { /* search end of saved-texts list */
- X CText = lasText;
- X lasText = lasText->NextText;
- X };
- X lasText = CText;
- X CText = (struct IntuiText *) malloc (sizeof (struct IntuiText));
- X CText->NextText = NULL;
- X if( AllText == NULL )
- X AllText = CText;
- X else
- X lasText->NextText = CText;
- X
- X tptr = Scan (ptr, ',', TRUE);
- X CText->IText = (UBYTE *) malloc (tptr-ptr+1);
- X strncpy (CText->IText, ptr, tptr-ptr);
- X if (CMenu->Width <= tptr-ptr) CMenu->Width = tptr-ptr;
- X
- X/* check for duplicate, eliminate this one if duplicate */
- X
- X dptr = AllText;
- X while (dptr != CText) {
- X if (strcmp (dptr->IText, CText->IText) == 0 ) {
- X free ((char *) (CText->IText));
- X free ((char *) CText);
- X CText = dptr;
- X lasText->NextText = NULL;
- X }
- X else dptr = dptr->NextText;
- X }
- X return (CText);
- X}
- X
- XDo_Output()
- X
- X{
- X char nxt, quote, Flag[10];
- X char Mptr[14];
- X int Menu, Item, left, top, width, height;
- X int stop;
- X char rest[60];
- X
- X ofile = fopen (ofname, "w"); /* open file for writing */
- X if (ofile == NULL) {
- X printf (" Cannot open file %s for output!\n", ofname);
- X exit (10);
- X }
- X
- X/* Output the IntuiText structure first */
- X
- X quote = '"';
- X fprintf (ofile, "/*****************************************/\n");
- X fprintf (ofile, "/* This code was generated by: */\n");
- X fprintf (ofile, "/* MakeMenu V1.0 (Hans Jansen 7-oct-90) */\n");
- X fprintf (ofile, "/*****************************************/\n");
- X fprintf (ofile, "#include <exec/types.h>\n");
- X fprintf (ofile, "#include <intuition/intuition.h>\n");
- X
- X CText = AllText;
- X if (AllText != NULL) {
- X fprintf (ofile, "\nstruct IntuiText IText[] =\n");
- X fprintf (ofile, " {\n");
- X };
- X
- X while (CText != NULL) { /* for all text to output */
- X if (CText->NextText == NULL) nxt = ' ';
- X else nxt = ',';
- X fprintf (ofile, " { 0, 1, JAM2, CHECKWIDTH, 0, NULL, %c%s%c, NULL }%c\n",
- X quote, CText->IText, quote, nxt);
- X CText = CText->NextText;
- X };
- X
- X if (AllText != NULL) fprintf (ofile," };\n\n");
- X
- X CMenu = AllMenu;
- X Menu = 0;
- X left = 0;
- X Item = 0;
- X height = 10;
- X
- X while (CMenu != NULL) { /* first output the subitems, if any */
- X Item = 0;
- X CItem = CMenu->FirstItem;
- X while (CItem != NULL) {
- X CSItem = CItem->SubItem;
- X if (CSItem != NULL) Do_Out_Sub (Menu,Item);
- X Item++;
- X CItem = CItem->NextItem;
- X };
- X Menu++;
- X CMenu = CMenu->NextMenu;
- X }
- X
- X CMenu = AllMenu;
- X Menu = 0;
- X left = 0;
- X Item = 0;
- X height = 10;
- X
- X while (CMenu != NULL) { /* now output the items */
- X Item = 0;
- X CItem = CMenu->FirstItem;
- X CSItem = CItem->SubItem;
- X top = 0;
- X fprintf (ofile, "struct MenuItem M%d[] = \n",Menu);
- X fprintf (ofile, " {\n");
- X top = 0;
- X width = CMenu->Width * CHAR_WIDTH;
- X
- X while (CItem != NULL) {
- X Item++;
- X CSItem = CItem->SubItem;
- X
- X if (CItem->NextItem == NULL) fprintf (ofile, " {NULL, ");
- X else fprintf (ofile, " {&M%d[%2d], ", Menu, Item);
- X fprintf (ofile, "%3d, %3d, %3d+CHECKWIDTH, %3d,\n",
- X left, top, width, height);
- X fprintf (ofile, " ITEMTEXT|HIGHCOMP");
- X if ((CItem->Flags & ENABLE) == ENABLE) fprintf (ofile, "|ITEMENABLED");
- X if ((CItem->Flags & TOGGLE) == TOGGLE) fprintf (ofile, "|MENUTOGGLE");
- X if ((CItem->Flags & CHECK) == CHECK) fprintf (ofile, "|CHECKIT");
- X if ((CItem->Flags & SELECT) == SELECT) fprintf (ofile, "|CHECKED");
- X if (CItem->Command != NULL && CItem->Command != ' ')
- X fprintf (ofile, "|COMMSEQ");
- X fprintf (ofile, ",\n 0, (APTR)&IText[%2d], ",
- X Index(CItem->ItemFill));
- X if (CItem->SelectFill == NULL) fprintf (ofile, "NULL, ");
- X else fprintf (ofile, "(APTR)&IText[%2d], ", Index(CItem->SelectFill));
- X if (CItem->Command == NULL || CItem->Command == ' ')
- X fprintf (ofile, "NULL, ");
- X else fprintf (ofile, "'%c', ", CItem->Command);
- X if (CSItem == NULL) fprintf (ofile, "NULL, MENUNULL}");
- X else fprintf (ofile, "&M%dI%d[0], MENUNULL}", Menu, (Item-1));
- X if (CItem->NextItem == NULL) fprintf (ofile, "\n");
- X else fprintf (ofile, ",\n");
- X
- X CItem = CItem->NextItem;
- X top = top + height;
- X };
- X fprintf (ofile, " };\n\n");
- X CMenu = CMenu->NextMenu;
- X Menu++;
- X };
- X
- X CMenu = AllMenu;
- X fprintf (ofile, "struct Menu TheMenu[] =\n");
- X fprintf (ofile, " {\n");
- X left = 0;
- X top = 0;
- X Menu = 0;
- X
- X while (CMenu != NULL) { /* finally, the menus themselves */
- X Menu++;
- X width = CMenu->Width * CHAR_WIDTH;
- X if (CMenu->NextMenu == NULL) { /* the NextMenu pointer */
- X sprintf (Mptr, "NULL ");
- X nxt = ' ';
- X }
- X else {
- X sprintf (Mptr, "&TheMenu[%2d]", Menu);
- X nxt = ',';
- X };
- X (void) strncpy (rest, " ", 25);
- X stop = CMenu->Width - strlen (CMenu->MenuName); /* the name string */
- X if (stop <= 0)
- X (void) strncpy (rest, CMenu->MenuName, 25);
- X else {
- X stop = stop / 2;
- X (void) strncpy (&rest[stop], CMenu->MenuName, 25-stop);
- X (void) strncat (rest, " ", 25);
- X };
- X
- X quote = '"';
- X height = 10;
- X fprintf (ofile, " {%12s, %3d, %3d, %3d+CHECKWIDTH, %3d,\n",
- X Mptr, left, top, width, height);
- X if ((CMenu->Flags & ENABLE) == ENABLE)
- X fprintf (ofile, "MENUENABLED");
- X else
- X fprintf (ofile, "0");
- X fprintf (ofile, ",%c%s%c, &M%d[0]}%c\n",
- X quote, rest, quote, (Menu-1), nxt);
- X left = left + width + 4*CHAR_WIDTH;
- X CMenu = CMenu->NextMenu;
- X };
- X fprintf (ofile, " };\n\n");
- X fprintf (ofile, "struct Menu *MyMenu = &TheMenu[0];\n\n");
- X
- X fprintf (ofile, "/*****************************************/\n");
- X fprintf (ofile, "/* End of generated code */\n");
- X fprintf (ofile, "/*****************************************/\n");
- X
- X fclose (ofile);
- X}
- X
- Xint Index (ptr) /* Find the position index */
- X struct IntuiText *ptr;
- X {
- X int idx;
- X
- X idx = 0;
- X CText = AllText;
- X
- X while (CText != NULL && ptr != CText) {
- X idx++;
- X CText = CText->NextText;
- X };
- X return (idx);
- X}
- X
- XDo_Out_Sub (Menu, Item) /* output an item's SubItems */
- X int Menu, Item;
- X{
- X int SItem;
- X int stop, width, sleft;
- X int top, height;
- X char Mptr[14];
- X char rest[60];
- X char nxt, Flag[10];
- X
- X SItem = 0;
- X top = 0;
- X height = 10;
- X fprintf (ofile, "struct MenuItem M%dI%d[] = \n", Menu, Item);
- X fprintf (ofile, " {\n");
- X width = CMenu->Width*CHAR_WIDTH;
- X SItem = 0;
- X while (CSItem != NULL) {
- X SItem++;
- X sleft = (width * 7) / 10;
- X stop = top + 2;
- X if (CSItem->NextItem == NULL) fprintf (ofile, " {NULL, ");
- X else fprintf (ofile, " {&M%dI%d[%2d], ", Menu, Item, SItem);
- X fprintf (ofile, "%3d, %3d, %3d+CHECKWIDTH, %3d,\n",
- X sleft, stop, width, height);
- X fprintf (ofile, " ITEMTEXT|HIGHCOMP");
- X if ((CSItem->Flags & ENABLE) == ENABLE) fprintf (ofile, "|ITEMENABLED");
- X if ((CSItem->Flags & TOGGLE) == TOGGLE) fprintf (ofile, "|MENUTOGGLE");
- X if ((CSItem->Flags & CHECK) == CHECK) fprintf (ofile, "|CHECKIT");
- X if ((CSItem->Flags & SELECT) == SELECT) fprintf (ofile, "|CHECKED");
- X if (CSItem->Command != NULL && CSItem->Command != ' ')
- X fprintf (ofile, "|COMMSEQ");
- X fprintf (ofile, ",\n 0, (APTR)&IText[%2d], ",
- X Index(CSItem->ItemFill));
- X if (CSItem->SelectFill == NULL) fprintf (ofile, "NULL, ");
- X else fprintf (ofile, "(APTR)&IText[%2d], ", Index(CSItem->SelectFill));
- X if (CSItem->Command == NULL || CSItem->Command == ' ')
- X fprintf (ofile, "NULL, ");
- X else fprintf (ofile, "'%c', ", CSItem->Command);
- X fprintf (ofile, "NULL, MENUNULL}");
- X if (CSItem->NextItem == NULL) fprintf (ofile, "\n");
- X else fprintf (ofile, ",\n");
- X
- X CSItem = CSItem->NextItem;
- X top = top + height;
- X };
- X fprintf (ofile," };\n\n");
- X}
- END_OF_FILE
- if test 14632 -ne `wc -c <'makemenu.c'`; then
- echo shar: \"'makemenu.c'\" unpacked with wrong size!
- fi
- chmod +x 'makemenu.c'
- # end of 'makemenu.c'
- fi
- if test -f 'makemenu.o.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'makemenu.o.uu'\"
- else
- echo shar: Extracting \"'makemenu.o.uu'\" \(9842 characters\)
- sed "s/^X//" >'makemenu.o.uu' <<'END_OF_FILE'
- Xbegin 700 makemenu.o
- XM```#YP````````/H`````3,```````/K```!+````^\!```"7V-L:6YE````#
- XM`````0```E]296-"=68`````A`$```)?:69N86UE````!(0!```"7V]F;F%MJ
- XM90````2(`0```E]O9FEL90`````$C`$```-?16YD3V9&:6QE``````20`0``V
- XM`E]L8VYT```````$E`$```)?0U1E>'0`````!)@!```"7T%L;%1E>'0```2<0
- XM`0```E]#271E;0`````$H`$```)?0U-)=&5M````!*0!```"7T--96YU````!
- XM``2H`0```E]!;&Q-96YU```$K`````````/R```#Z`````$Q```````#Z0``J
- XM!6E.5?_B2.<?."XM``PD;0`(2?D```2$<``CP```!)QP`"/````$F'``(\``W
- XM``2H<``CP```!*!P`"/````$I'``(\````2L<``J`'``)D!P`"/````$E"`*F
- XM#(`````#9PY(>0``%7A.N0````!83W``*(!P`28`MHIL)"`49B`@1R`#Y8#1Y
- XMP"!0$!`,```M9PH@1R`#Y8#1P"B04H-@V'``(\````2()@.VBFPL(#D```2($
- XM9B0@1R`#Y8#1P"!0$!`,```M9PX@1R`#Y8#1P"/0```$B%*#8-!P`"/````$C
- XMD$AY```5=B\43KD`````4$\L`&8<+Q1(>0``%51.N0````!03TAX``I.N0``7
- XM``!83TAX`(1(>0`````O!DZY```"A-[\``PK0/_T("W_]&\``/!!^0`````HS
- XM"'``)@`,@P````1L("!$T<,0$$B`2,`O`$ZY`````%A/0>W_X]'#$(!2@V#8#
- XM0>W_X]'#0A!(>``!2'@`+"\$3KD```(\WOP`#"@`2&W_XTAY```53DZY````K
- XM`%!/2H!F#B\$3KD```+>6$\J`&!22&W_XTAY```52$ZY`````%!/2H!F$$*G^
- XM+P1.N0```^103RH`8"Q(;?_C2'D``!5"3KD`````4$]*@&822'@``2\$3KD`(
- XM``/D4$\J`&`$<`<J`$J%9QY22TAY`````"\Y```$E$AY```5)$ZY`````-[\"
- XM``Q@`/[R+P9.N0````!83R`+9@9.N0``!LY,WQSX3EU.=4Y5``!(YQP`)BT`?
- XM""@M``PJ+0`0($,0$&<D2H5G#"!#$!!(@$C`L(1F$$J%9A`@0Q`02(!(P+"$I
- XM9@12@V#6(`-,WP`X3EU.=4Y5```O`R8M``Q2N0``!)0O+0`(+RT`$"\#3KD`)
- XM````WOP`#$J`9A!P`2/````$D'``)A].74YU+P-.N0````!83R!#T<`@"$(H7
- XM__\O`TZY`````%A/8-I@V$Y5__1(YQXX)BT`"$7Y```$J$?Y`````$GY```$V
- XMK"`49@Y(>``>3I-83RB`))1@$"P22'@`'DZ36$\D@"!&()(@0Q`0#```+&<*6
- XM<`%,WQQX3EU.=5*#($,0$`P``$1G"B!#$!`,``!D9A!P`'(`$@`@`2!2,4``8
- XM#&`.<`%R`!(`(`$@4C%```Q(>``!2'@`+"\#3KK^RM[\``PF`"!#$!`,```LU
- XM9P1P`6"B4H-(>``!0J<O`TZZ_JC>_``,*@"0@R@`4H`O`$Z36$\@4B%```XOA
- XM`R!2+R@`#DZY`````%!/<``@4B"`<``@4B%``!)P`"/````$H"`$5H`@4C%`K
- XM``AP`&``_TA.5?_T2.<?,"8M``A%^0``!*!'^0``!*0N+0`,(#D```2H9@IPD
- XM`TS?#/A.74YU#(<````!9@@@$F8$<`1@Z"!#$!`,```L9P1P`6#:2H=F+"P2L
- XM<``F@$AX`").N0````!83R2`2H9F#"!Y```$J"%2`!)@!"!&()(H$F`B*A-(3
- XM>``B3KD`````6$\F@$J%9@@@4B%3`!Q@!"!%(),H$U*#<`%R`!(`(`$@1#%`D
- XM``P@0Q`0#```+&<``'X@0Q`0#```1&<*($,0$`P``&1F"B!$`FC__@`,8%@@"
- XM0Q`0#```5&<*($,0$`P``'1F"B!$`&@``@`,8#H@0Q`0#```0V<*($,0$`P`M
- XM`&-F"B!$`&@`!``,8!P@0Q`0#```4V<*($,0$`P``'-F""!$`&@`"``,4H-@#
- XM`/]Z4H,O`TZY```%NEA/($0A0``2($0@*``29@9P`F``_M)(>``!2'@`+"\#O
- XM3KK\]M[\``PF`"!#$!`,```L9P9P`6``_JY2@R\#3KD```6Z6$\@1"%``!9("
- XM>``!2'@`+"\#3KK\P-[\``PF`"!#$!`,```L9P9P`6``_GA2@W``($0@@'``/
- XM($0A0``<($,B1!-0`!IP`"!$(4``#G``8`#^4DY5__1(YQXP1?D```28*"T`,
- XM"$?Y```$G"!$$!`,```L9@IP`$S?#'A.74YU)A-*@V<*)(,@0R8H`!!@\B82*
- XM2'@`%$ZY`````%A/)(!P`"!2(4``$"`39@0FDF`&($,A4@`02'@``4AX`"POV
- XM!$ZZ_!3>_``,+`"0A%*`+P!.N0````!83R!2(4``#"`&D(0O`"\$(%(O*``,!
- XM3KD`````WOP`#"!Y```$J#`H``A(P"(&DH2P@6X.(`:0A"!Y```$J#%```@JG
- XM$[J29T0@4B\H``P@12\H``Q.N0````!03TJ`9B0@4B\H``Q.N0````!83R\2E
- XM3KD`````6$\DA7``($,A0``08`8@12HH`!!@N"`28`#_$DY5_XY(YQ\X1?D`W
- XM``2,1_D`````2?D```2@0?D```2H*`A(>0``%2(O.0``!(A.N0````!03R2`"
- XM(!)F("\Y```$B$AY```5`$ZY`````%!/2'@`"DZY`````%A/&WP`(O_^2'D`7
- XM`!32+Q).DU!/2'D``!2D+Q).DU!/2'D``!1V+Q).DU!/2'D``!1(+Q).DU!/+
- XM2'D``!0N+Q).DU!/2'D``!0,+Q).DU!/(_D```2<```$F"`Y```$G&<82'D`W
- XM`!/N+Q).DU!/2'D``!/H+Q).DU!/(#D```289V`@>0``!)@@*``09@@;?``@M
- XM__]@!AM\`"S__Q`M__](@$C`+P`0+?_^2(!(P"\`('D```28+R@`#!`M__Y(R
- XM@$C`+P!(>0``$ZXO$DZ3WOP`&"!Y```$F"/H`!````288)@@.0``!)QG#$AY>
- XM```3IB\23I-03R!$(+D```2L<``F`'``+@!P`"H`<`HK0/_.($0@$&="<``J^
- XM`"!$(%`HJ``2(!1G)B!4(^@`'```!*0@.0``!*1G#"\%+P-.N0``#7103U*%2
- XM(%0HD@H,@1"!0(D0BD&"X($0@N0``!*QP`"8`<``N`'``*@!P"BM`_\X@(
- XM1"`09P`"9G``*@`@1"!0**@`$B!4(^@`'```!*1P`"P`+P-(>0``$XPO$DZ3F
- XMWOP`#$AY```3AB\23I-03W``+``@1"!0,"@`"$C`YX`K0/_2(!1G``'\4H4@+
- XM5"/H`!P```2D(%0@$&8.2'D``!-Z+Q).DU!/8!(O!2\#2'D``!-H+Q).D][\:
- XM`!`O+?_.+RW_TB\&+P=(>0``$T@O$DZ3WOP`&$AY```3,"\23I-03R!4,"@`2
- XM#'(`,@`@`0*``````0R``````68,2'D``!,B+Q).DU!/(%0P*``,<@`R`"`!G
- XM`H`````"#(`````"9@Q(>0``$Q8O$DZ34$\@5#`H``QR`#(`(`$"@`````0,>
- XM@`````1F#$AY```3#"\23I-03R!4,"@`#'(`,@`@`0*`````"`R`````"&8,$
- XM2'D``!,"+Q).DU!/(%00*``:9Q@@5!`H`!H,```@9PQ(>0``$O@O$DZ34$\@M
- XM5"\H`!).N0``#3Q83R\`2'D``!+8+Q).D][\``P@5"`H`!9F#DAY```2T"\2`
- XM3I-03V`>(%0O*``63KD```T\6$\O`$AY```2O"\23I/>_``,(%00*``:9PP@U
- XM5!`H`!H,```@9@Y(>0``$K0O$DZ34$]@&B!4$"@`&DB`2,`O`$AY```2K"\2-
- XM3I/>_``,(#D```2D9@Y(>0``$IPO$DZ34$]@%B`%4X`O`"\#2'D``!*&+Q).C
- XMD][\`!`@5"`09@Y(>0``$H0O$DZ34$]@#$AY```2@"\23I-03R!4*)`@!M"M\
- XM_\XL`&``_@)(>0``$G@O$DZ34$\@1"!0(D0BD%*#8`#]EB!$(+D```2L2'D`'
- XM`!)>+Q).DU!/2'D``!)8+Q).DU!/<``N`'``+`!P`"8`($0@$&<``;92@R!$8
- XM(%`P*``(2,#G@"M`_](@1"!0(!!F&DAY```23$AM_^9.N0````!03QM\`"#_4
- XM_V`<+P-(>0``$CY(;?_F3KD`````WOP`#!M\`"S__TAX`!E(>0``$AY(;?^.2
- XM3KD`````WOP`#"!$(%`P*``(2,`O`"!$(%`O*``.3KD`````6$\B`"`?D($K<
- XM0/_*("W_RFX<2'@`&2!$(%`O*``.2&W_CDZY`````-[\``Q@5$AX``(O+?_*%
- XM3KD`````(!]83RM`_\IP&9"M_\HO`"!$(%`O*``.0>W_CB`(T*W_RB\`3KD`W
- XM````WOP`#$AX`!E(>0``$@1(;?^.3KD`````WOP`#!M\`"+__G`**T#_SB\M)
- XM_\XO+?_2+P8O!TAM_^9(>0``$=@O$DZ3WOP`'"!$(%`P*``,<@`R`"`!`H```
- XM```!#(`````!9@Y(>0``$<PO$DZ34$]@#$AY```1RB\23I-03Q`M__](@$C`U
- XM+P`@`U.`+P`0+?_^2(!(P"\`2&W_CA`M__Y(@$C`+P!(>0``$;0O$DZ3WOP`*
- XM'"`'T*W_T@:`````("X`($0@4")$(I!@`/Y&2'D``!&L+Q).DU!/2'D``!&&,
- XM+Q).DU!/2'D``!%8+Q).DU!/2'D``!$J+Q).DU!/2'D``!#\+Q).DU!/+Q).&
- XMN0````!83TS?'/A.74YU3E7__$CG$"!%^0``!)AP`"8`)+D```2<(!)G$B`MO
- XM``BPDF<*4H,@4B2H`!!@ZB`#3-\$"$Y=3G5.5?^22.<?.$7Y```$C$?Y````X
- XM`$GY```$I'``*`!P`"8`<`HL`"\M``PO+0`(2'D``!#>+Q).D][\`!!(>0``&
- XM$-@O$DZ34$\@>0``!*@P*``(2,#G@"H`<``H`"`49P`!]E*$(`4B`-*!T('2D
- XM@="!2'@`"B\`3KD`````(!]83RM`__`@`U2`+@`@5"`09@Y(>0``$,PO$DZ3.
- XM4$]@&"\$+RT`#"\M``A(>0``$+@O$DZ3WOP`%"\&+P4O!R\M__!(>0``$)@OQ
- XM$DZ3WOP`&$AY```0@"\23I-03R!4,"@`#'(`,@`@`0*``````0R``````68,6
- XM2'D``!!R+Q).DU!/(%0P*``,<@`R`"`!`H`````"#(`````"9@Q(>0``$&8O+
- XM$DZ34$\@5#`H``QR`#(`(`$"@`````0,@`````1F#$AY```07"\23I-03R!49
- XM,"@`#'(`,@`@`0*`````"`R`````"&8,2'D``!!2+Q).DU!/(%00*``:9Q@@"
- XM5!`H`!H,```@9PQ(>0``$$@O$DZ34$\@5"\H`!).NOXN6$\O`$AY```0*"\2`
- XM3I/>_``,(%0@*``69@Y(>0``$"`O$DZ34$]@'"!4+R@`%DZZ_?Q83R\`2'D`T
- XM`!`,+Q).D][\``P@5!`H`!IG#"!4$"@`&@P``"!F#DAY```0!"\23I-03V`:3
- XM(%00*``:2(!(P"\`2'D```_\+Q).D][\``Q(>0``#^PO$DZ34$\@5"`09@Y(V
- XM>0``#^HO$DZ34$]@#$AY```/YB\23I-03R!4*)`@`]"&)@!@`/X(2'D```_>U
- XM+Q).DU!/3-\<^$Y=3G4@('T["@H``"P*```*`$Y53$PL($U%3E5.54Q,?0`G5
- XM)6,G+"```$Y53$PL(```*$%05%(I)DE497AT6R4R9%TL(`!.54Q,+"```"P*:
- XM("`@("`@,"P@*$%05%(I)DE497AT6R4R9%TL(```?$-/34U315$``'Q#2$5#W
- XM2T5$``!\0TA%0TM)5```?$U%3E543T='3$4`?$E414U%3D%"3$5$```@("`@4
- XM("!)5$5-5$585'Q(24=(0T]-4``E,V0L("4S9"P@)3-D*T-(14-+5TE$5$@L`
- XM("4S9"P*`"`@("![)DTE9$DE9%LE,F1=+"``("`@('M.54Q,+"``("!["@``A
- XM<W1R=6-T($UE;G5)=&5M($TE9$DE9%M=(#T@"@``+RHJ*BHJ*BHJ*BHJ*BHJK
- XM*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ+PH``"\J("`@("`@("`@16YDW
- XM(&]F(&=E;F5R871E9"!C;V1E("`@("`@("`@*B\*```O*BHJ*BHJ*BHJ*BHJI
- XM*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHO"@``<W1R=6-T($UE;G4@U
- XM*DUY365N=2`]("94:&5-96YU6S!=.PH*```@('T["@H``"PE8R5S)6,L("9-T
- XM)61;,%U])6,*```P`$U%3E5%3D%"3$5$`"`@("![)3$R<RP@)3-D+"`E,V0L"
- XM("4S9"M#2$5#2U=)1%1(+"`E,V0L"@``("`@("`@("`@("`@("`@("`@("`@#
- XM("`@(``@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@`"94:&5-96YU\
- XM6R4R9%T`3E5,3"`@("`@("``("!["@``<W1R=6-T($UE;G4@5&AE365N=5M=[
- XM(#T*```@('T["@H``"P*```*`"9-)61))61;,%TL($U%3E5.54Q,?0!.54Q,=
- XM+"!-14Y53E5,3'T`)R5C)RP@``!.54Q,+"```"A!4%12*29)5&5X=%LE,F1=Q
- XM+"``3E5,3"P@```L"B`@("`@(#`L("A!4%12*29)5&5X=%LE,F1=+"```'Q#?
- XM3TU-4T51``!\0TA%0TM%1```?$-(14-+250``'Q-14Y55$]'1TQ%`'Q)5$5-*
- XM14Y!0DQ%1```("`@("`@251%351%6%1\2$E'2$-/35``)3-D+"`E,V0L("4S2
- XM9"M#2$5#2U=)1%1(+"`E,V0L"@`@("`@>R9-)61;)3)D72P@```@("`@>TY5_
- XM3$PL(``@('L*``!S=')U8W0@365N=4ET96T@325D6UT@/2`*`"`@?3L*"@``3
- XM("`@('L@,"P@,2P@2D%-,BP@0TA%0TM724142"P@,"P@3E5,3"P@)6,E<R5C_
- XM+"!.54Q,('TE8PH``"`@>PH```IS=')U8W0@26YT=6E497AT($E497AT6UT@>
- XM/0H``"-I;F-L=61E(#QI;G1U:71I;VXO:6YT=6ET:6]N+F@^"@`C:6YC;'5D?
- XM92`\97AE8R]T>7!E<RYH/@H``"\J*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJQ
- XM*BHJ*BHJ*BHJ*BHJ*BHJ*B\*```O*B!-86ME365N=2!6,2XP("A(86YS($IA'
- XM;G-E;B`@-RUO8W0M.3`I("HO"@``+RH@("`@("!4:&ES(&-O9&4@=V%S(&=EC
- XM;F5R871E9"!B>3H@("`@("`J+PH``"\J*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ&
- XM*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*B\*```@0V%N;F]T(&]P96X@9FEL92`E<R!FJ
- XM;W(@;W5T<'5T(0H`=P`@3&EN92`E9"!H87,@<WEN=&%X(&5R<F]R.B5S"@!3!
- XM54))``!)5$5-``!-14Y5```@0V%N;F]T(&]P96X@9FEL92`E<R!F;W(@:6YP?
- XM=70A"@``<@!U<V%G93H@36%K94UE;G4@/&EN<'5T9FEL93X@/&]U='!U=&9I.
- XM;&4^"@!.<0```^P````X`````````!(````:````(@```"H````R````.@``C
- XM`$(```!2````H@```*X```#0````W````18```$T```"`@```@@```*0```"^
- XML````NP```+X```#T````_(```/X```$`@``!$X```7$```%S@``!EX```9VO
- XM```&V```!N0```;J```&^```!PP```=Z```'?@``!X0```>D```'K```!]H`9
- XM``?\```(!```"`P```@B```(5```"%H```B$```(M```"/H```J2```+"@``&
- XM#48```U0```-?@``#8H```V^````5@````$```!B````X@```/@```$>```!0
- XM>@```8H```&>```!K@```<0```'4```![````@X```(P```%(```!60```;RB
- XM```'$@``!S(```<^```'2@``!U8```=B```';@``!XP```>8```'[@``"!0`F
- XM``AF```(P```",X```D&```)&```"3(```E````)9@``"8P```FR```)V```@
- XM"?@```H*```*%```"BH```H^```*2```"FH```J$```*F@``"K````K$```*Y
- XMT@``"NX```L0```+'```"U8```MR```+D```#"P```Q<```,A@``#)0```S(K
- XM```,\```#/P```T(```-%```#2````VD```-L@``#@8```X>```.-@``#D0`M
- XM``YJ```.D```#K8```[<```._```#Q8```\L```/2```#VH```^$```/D@``R
- XM#Z0```^R```/S`````````/O`0```E]M86EN``````````$```)?4V-A;@``O
- XM`````CP!```"7T=E=$QI;F4```*$`0``!%]0<F]C97-S7TUE;G4```````+>E
- XM`0``!%]0<F]C97-S7TET96T```````/D`0``!%]0<F]C97-S7U1E>'0`````?
- XM``6Z`0```U]$;U]/=71P=70`````!LX!```"7TEN9&5X``````T\`0```U]$C
- XM;U]/=71?4W5B````#72!```"7W!R:6YT9@`````$````:````/X```(4```',
- XM&($```)?9F]P96X```````(```#J```&_H$```)?97AI=`````````(```$*K
- XM```')($```)?=&]U<'!E<@````$```%4@0```E]S=')C;7``````!````9``"
- XM``&T```!V@``!I*!```"7V9C;&]S90`````"```")```#2Z!```"7V9G971SD
- XM```````!```"H($```)?<W1R;&5N``````,```+````"U```"[B!```"7VUAK
- XM;&QO8P`````%```"\@``!$````1H```%_@``!CB!```"7W-T<F-P>0`````!<
- XM```#N($```)?<W1R;F-P>0````0```94```+F@``"^````P>@0```E]F<F5E,
- XM`````````@``!J0```:N@0```E]F<')I;G1F`````@``!MX```V$@0```E]S'
- XM<')I;G1F`````@``"V````M\@0```BYL9&EV<P```````@``"_0```WL@0``5
- X9`E]S=')N8V%T`````0``##8````````#\FEVW
- X``
- Xend
- Xsize 7000
- END_OF_FILE
- if test 9842 -ne `wc -c <'makemenu.o.uu'`; then
- echo shar: \"'makemenu.o.uu'\" unpacked with wrong size!
- fi
- # end of 'makemenu.o.uu'
- fi
- if test -f 'menu.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'menu.c'\"
- else
- echo shar: Extracting \"'menu.c'\" \(4525 characters\)
- sed "s/^X//" >'menu.c' <<'END_OF_FILE'
- X/*****************************************/
- X/* This code was generated by: */
- X/* MakeMenu V1.0 (Hans Jansen 7-oct-90) */
- X/*****************************************/
- X#include <exec/types.h>
- X#include <intuition/intuition.h>
- X
- Xstruct IntuiText IText[] =
- X {
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "New", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Open", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Save", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "SaveAs", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Print", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "NLQ", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Draft", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "About...", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Quit", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Undo", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Cut", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Copy", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Paste", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Erase All", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Sound", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Auto Save", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Have Your Cake", NULL },
- X { 0, 1, JAM2, CHECKWIDTH, 0, NULL, "Eat It Too", NULL }
- X };
- X
- Xstruct MenuItem M0I4[] =
- X {
- X {&M0I4[ 1], 56, 2, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[ 5], NULL, NULL, NULL, MENUNULL},
- X {NULL, 56, 12, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[ 6], NULL, NULL, NULL, MENUNULL}
- X };
- X
- Xstruct MenuItem M0[] =
- X {
- X {&M0[ 1], 0, 0, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[ 0], NULL, NULL, NULL, MENUNULL},
- X {&M0[ 2], 0, 10, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[ 1], NULL, 'O', NULL, MENUNULL},
- X {&M0[ 3], 0, 20, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[ 2], NULL, 'S', NULL, MENUNULL},
- X {&M0[ 4], 0, 30, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[ 3], NULL, NULL, NULL, MENUNULL},
- X {&M0[ 5], 0, 40, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[ 4], NULL, NULL, &M0I4[0], MENUNULL},
- X {&M0[ 6], 0, 50, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[ 7], NULL, NULL, NULL, MENUNULL},
- X {NULL, 0, 60, 80+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[ 8], NULL, 'Q', NULL, MENUNULL}
- X };
- X
- Xstruct MenuItem M1[] =
- X {
- X {&M1[ 1], 0, 0, 72+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[ 9], NULL, 'Z', NULL, MENUNULL},
- X {&M1[ 2], 0, 10, 72+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[10], NULL, 'X', NULL, MENUNULL},
- X {&M1[ 3], 0, 20, 72+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[11], NULL, 'C', NULL, MENUNULL},
- X {&M1[ 4], 0, 30, 72+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|COMMSEQ,
- X 0, (APTR)&IText[12], NULL, 'V', NULL, MENUNULL},
- X {NULL, 0, 40, 72+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP,
- X 0, (APTR)&IText[13], NULL, NULL, NULL, MENUNULL}
- X };
- X
- Xstruct MenuItem M2[] =
- X {
- X {&M2[ 1], 0, 0, 112+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED,
- X 0, (APTR)&IText[14], NULL, NULL, NULL, MENUNULL},
- X {&M2[ 2], 0, 10, 112+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|MENUTOGGLE|CHECKIT|CHECKED,
- X 0, (APTR)&IText[15], NULL, NULL, NULL, MENUNULL},
- X {&M2[ 3], 0, 20, 112+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|CHECKIT|CHECKED,
- X 0, (APTR)&IText[16], NULL, NULL, NULL, MENUNULL},
- X {NULL, 0, 30, 112+CHECKWIDTH, 10,
- X ITEMTEXT|HIGHCOMP|ITEMENABLED|CHECKIT,
- X 0, (APTR)&IText[17], NULL, NULL, NULL, MENUNULL}
- X };
- X
- Xstruct Menu TheMenu[] =
- X {
- X { &TheMenu[ 1], 0, 0, 80+CHECKWIDTH, 10,
- XMENUENABLED," Project ", &M0[0]},
- X { &TheMenu[ 2], 112, 0, 72+CHECKWIDTH, 10,
- XMENUENABLED," Edit ", &M1[0]},
- X { NULL , 216, 0, 112+CHECKWIDTH, 10,
- XMENUENABLED," Preferences ", &M2[0]}
- X };
- X
- Xstruct Menu *MyMenu = &TheMenu[0];
- X
- X/*****************************************/
- X/* End of generated code */
- X/*****************************************/
- END_OF_FILE
- if test 4525 -ne `wc -c <'menu.c'`; then
- echo shar: \"'menu.c'\" unpacked with wrong size!
- fi
- chmod +x 'menu.c'
- # end of 'menu.c'
- fi
- if test -f 'menu.o.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'menu.o.uu'\"
- else
- echo shar: Extracting \"'menu.o.uu'\" \(2463 characters\)
- sed "s/^X//" >'menu.o.uu' <<'END_OF_FILE'
- Xbegin 700 menu.o
- XM```#YP````````/H`````3(```````/J```!"P`!`0``$P```````````.@`^
- XM``````$!```3````````````X@```````0$``!,```````````#<```````!I
- XM`0``$P```````````-0```````$!```3````````````S@```````0$``!,`@
- XM``````````#*```````!`0``$P```````````,0```````$!```3````````X
- XM````N@```````0$``!,```````````"T```````!`0``$P```````````*X`&
- XM``````$!```3````````````J@```````0$``!,```````````"D```````!Y
- XM`0``$P```````````)X```````$!```3````````````E````````0$``!,`P
- XM``````````".```````!`0``$P```````````(0```````$!```3````````\
- XM````=````````0$``!,```````````!H`````````8H`.``"`&,`"@!2````U
- XM`````&0`````````````__\``````#@`#`!C``H`4@````````!X````````=
- XM`````/__```!S@``````8P`*`%(```````````````````````#__P```?``[
- XM```*`&,`"@!6`````````!0`````3P``````__\```(2````%`!C``H`5@``9
- XM```````H`````%,``````/__```"-````!X`8P`*`%(`````````/```````(
- XM``````#__P```E8````H`&,`"@!2`````````%````````````%H__\```)XN
- XM````,@!C``H`4@````````",`````````````/__`````````#P`8P`*`%8`Z
- XM````````H`````!1``````#__P```KP``````%L`"@!6`````````+0`````<
- XM6@``````__\```+>````"@!;``H`5@````````#(`````%@``````/__```#>
- XM`````!0`6P`*`%8`````````W`````!#``````#__P```R(````>`%L`"@!6J
- XM`````````/``````5@``````__\`````````*`!;``H`0@````````$$````8
- XM`````````/__```#9@``````@P`*`%(````````!&`````````````#__P``=
- XM`X@````*`(,`"@%;`````````2P`````````````__\```.J````%`"#``H!X
- XM4P````````%``````````````/__`````````!X`@P`*`%,````````!5```E
- XM``````````#__P```^H``````&,`"@`!````1@```:P`````````````!`@`8
- XM<````%L`"@`!````)@```IH`````````````````V````(,`"@`!````````^
- XM`T0``````````````\Q.<0```^P````G`````````6@```%Z```!G````:P`9
- XM``&^```!S@```>````'P```"`@```A(```(D```"-````D8```)0```"5@``&
- XM`F@```**```"F@```JP```*\```"S@```MX```+P```#`````Q(```,T```#R
- XM1````U8```-F```#>````X@```.:```#O````\P```/>```#Z@```_P```0:B
- XM```$)@```!4````!````#````"`````T````2````%P```!P````A````)@`0
- XM``"L````P````-0```#H````_````1````$D```!.````4P```%@```#V@``>
- XM`_@```06`````````^\!```"7TE497AT`````````0```E]-,$DT```````!T
- XM:`$```%?33`````!K`$```%?33$````"F@$```%?33(````#1`$```)?5&AE8
- XM365N=0```\P!```"7TUY365N=0````0F`````````_(```/H`````3$`````=
- XM``/I````.R!0<F5F97)E;F-E<R`@("`@("`@("`@("`@("`@("`@("`@("``9
- XM("!%9&ET("`@("`@("`@("`@("`@("`@("`@("`@(``@4')O:F5C="`@("`@]
- XM("`@("`@("`@("`@("`@("`@("``16%T($ET(%1O;P``2&%V92!9;W5R($-A@
- XM:V4``$%U=&\@4V%V90!3;W5N9`!%<F%S92!!;&P`4&%S=&4`0V]P>0``0W5T.
- XM`%5N9&\``%%U:70``$%B;W5T+BXN``!$<F%F=`!.3%$`4')I;G0`4V%V94%SJ
- X6``!3879E``!/<&5N``!.97<````#\@!$$
- X``
- Xend
- Xsize 1732
- END_OF_FILE
- if test 2463 -ne `wc -c <'menu.o.uu'`; then
- echo shar: \"'menu.o.uu'\" unpacked with wrong size!
- fi
- # end of 'menu.o.uu'
- fi
- if test -f 'menu.test' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'menu.test'\"
- else
- echo shar: Extracting \"'menu.test'\" \(324 characters\)
- sed "s/^X//" >'menu.test' <<'END_OF_FILE'
- Xmenu,,Project
- Xitem,,New,,
- Xitem,,Open,,O
- Xitem,,Save,,S
- Xitem,,SaveAs,,
- Xitem,,Print,,
- Xsubi,,NLQ,,
- Xsubi,,Draft,,
- Xitem,,About...,,
- Xitem,,Quit,,Q
- Xmenu,,Edit
- Xitem,,Undo,,Z
- Xitem,,Cut,,X
- Xitem,,Copy,,C
- Xitem,,Paste,,V
- Xitem,D,Erase All,,
- Xmenu,,Preferences
- Xitem,,Sound,,
- Xitem,CTS,Auto Save,,
- Xitem,CS,Have Your Cake,,
- Xitem,C,Eat It Too,,
- END_OF_FILE
- if test 324 -ne `wc -c <'menu.test'`; then
- echo shar: \"'menu.test'\" unpacked with wrong size!
- fi
- chmod +x 'menu.test'
- # end of 'menu.test'
- fi
- if test -f 'testmenu.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'testmenu.c'\"
- else
- echo shar: Extracting \"'testmenu.c'\" \(5699 characters\)
- sed "s/^X//" >'testmenu.c' <<'END_OF_FILE'
- X/* TestMenu.c V1.0 (14-oct-90) - by Hans Jansen
- X *
- X * Program to exercise the output from MakeMenu V1.0, enabling you to
- X * quickly prototype a menu for your own application program.
- X *
- X * This program was adapted from the RKM example Menus.c (from chapter
- X * Intuition:Menus, page 125-133; also published on Fish Disk #344, the
- X * "Libs&DevsCompanion"). The original program carried the following
- X * copyright statement:
- X */
- X
- X/* Copyright (c) 1990 Commodore-Amiga, Inc.
- X *
- X * This example is provided in electronic form by Commodore-Amiga, Inc. for
- X * use with the 1.3 revisions of the Addison-Wesley Amiga reference manuals.
- X * The 1.3 Addison-Wesley Amiga Reference Manual series contains additional
- X * information on the correct usage of the techniques and operating system
- X * functions presented in this example. The source and executable code of
- X * this example may only be distributed in free electronic form, via bulletin
- X * board or as part of a fully non-commercial and freely redistributable
- X * diskette. Both the source and executable code (including comments) must
- X * be included, without modification, in any copy. This example may not be
- X * published in printed form or distributed with any commercial product.
- X * However, the programming techniques and support routines set forth in
- X * this example may be used in the development of original executable
- X * software products for Commodore Amiga computers.
- X * All other rights reserved.
- X * This example is provided "as-is" and is subject to change; no warranties
- X * are made. All use is at your own risk. No liability or responsibility
- X * is assumed.
- X */
- X
- X#include <exec/types.h>
- X#include <intuition/intuition.h>
- X#include <intuition/intuitionbase.h>
- X#include <libraries/dos.h>
- X#include <stdlib.h>
- X#include <stdio.h>
- X#include <string.h>
- X
- X/* Use lowest non-obsolete version that supplies the functions you need. */
- X#define LIB_REV 33
- X
- X/* prototypes */
- XUBYTE handleIDCMP(struct Window *);
- XVOID OpenAll(VOID);
- XVOID cleanExit(int);
- X
- X/* Globals */
- Xstruct IntuitionBase *IntuitionBase = NULL;
- Xstruct GfxBase *GfxBase = NULL;
- Xstruct Window *window = NULL;
- X
- Xstruct IntuiText WinText =
- X {3, 0, JAM2, 20, 20, NULL, "Activate MenuItem or CloseGadget",NULL};
- X
- Xstruct NewWindow NewWindow = {
- X 0, 10, 640, 100, 2, 1, MENUPICK|CLOSEWINDOW,
- X WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|ACTIVATE|NOCAREREFRESH,
- X NULL, NULL, "TestMenu V1.0 (12-oct-90) - by Hans Jansen",
- X NULL, NULL, 0, 0, -1, -1, WBENCHSCREEN
- X };
- X
- Xextern struct Menu *MyMenu;
- X
- XVOID main (int argc, char *argv[])
- X{
- X/* Declare variables here */
- XULONG signalmask, signals;
- XUBYTE done = 0;
- X
- XOpenAll();
- X
- X/* Set up the signals that you want to hear about ... */
- Xsignalmask = 1L << window->UserPort->mp_SigBit;
- X
- X/* And wait to hear from your signals */
- Xwhile( !done )
- X {
- X signals = Wait(signalmask);
- X if(signals & signalmask)
- X done = handleIDCMP(window);
- X };
- X
- X/* Exit the program */
- XcleanExit(RETURN_OK);
- X}
- X
- X
- X/* Handle the IDCMP messages */
- XUBYTE handleIDCMP( struct Window *win )
- X{
- XUBYTE flag = 0;
- XUSHORT code, selection, flags;
- Xstruct IntuiMessage *message = NULL;
- XULONG class, menuNum, itemNum, subNum;
- X
- X/* Examine pending messages */
- Xwhile(message = (struct IntuiMessage *)GetMsg(win->UserPort))
- X {
- X class = message->Class;
- X code = message->Code;
- X
- X/* When we're through with a message, reply */
- X ReplyMsg((struct Message *)message);
- X
- X/* See what events occurred */
- X switch( class )
- X {
- X case CLOSEWINDOW:
- X flag = 1;
- X break;
- X case MENUPICK:
- X selection = code;
- X while(selection != -1) /* MENUNULL does not work for PDC V3.33... */
- X {
- X/* (uncomment this to see why...)
- X printf ("selection = %x, MENUNULL = %x\n", selection, MENUNULL);
- X*/
- X menuNum = MENUNUM(selection);
- X itemNum = ITEMNUM(selection);
- X subNum = SUBNUM(selection);
- X flags = ((struct MenuItem *)
- X ItemAddress(MyMenu,(LONG)selection))->Flags;
- X /* Show the selection (in the invoking CLI window!) */
- X printf("Selected menu %d, item %d", menuNum, itemNum);
- X if (subNum != NOSUB) printf (", subitem %d", subNum);
- X if(flags&CHECKED) printf(" (Checked) ");
- X printf ("\n");
- X /* See if there are more selections */
- X selection = ((struct MenuItem *)ItemAddress
- X (MyMenu,(LONG)selection))->NextSelect;
- X } /* end while */
- X break; /* case of MENUPICK */
- X default:
- X break;
- X } /* end switch */
- X } /* end while */
- Xreturn(flag);
- X}
- X
- X
- X/* Open the needed libraries, windows, etc. */
- XVOID OpenAll (VOID)
- X{
- X/* Open the Intuition Library */
- XIntuitionBase = (struct IntuitionBase *)
- X OpenLibrary( "intuition.library",LIB_REV);
- Xif(IntuitionBase == NULL)
- X cleanExit(RETURN_WARN);
- X
- X/* Open the Graphics Library */
- XGfxBase = (struct GfxBase *)
- X OpenLibrary("graphics.library", LIB_REV);
- Xif(GfxBase == NULL)
- X cleanExit(RETURN_WARN);
- X
- X/* Open the window */
- Xwindow = OpenWindow(&NewWindow);
- Xif(window == NULL)
- X cleanExit(RETURN_WARN);
- X
- X/* Give a brief explanation of the program */
- XPrintIText(window->RPort,&WinText,0,0);
- X
- X/* attach the menu to the window */
- XSetMenuStrip(window, MyMenu);
- X}
- X
- X
- X/* Free up all the resources that we where using */
- XVOID cleanExit (int returnValue)
- X{
- Xif(window)
- X {
- X/* If there is a menu strip, then remove it */
- X if(window->MenuStrip)
- X ClearMenuStrip(window);
- X
- X/* Close the window */
- X CloseWindow(window);
- X }
- X
- X/* Close the library, and then exit */
- Xif(GfxBase)
- X CloseLibrary((struct Library *)GfxBase);
- X
- Xif(IntuitionBase)
- X CloseLibrary((struct Library *)IntuitionBase);
- Xexit(returnValue);
- X}
- END_OF_FILE
- if test 5699 -ne `wc -c <'testmenu.c'`; then
- echo shar: \"'testmenu.c'\" unpacked with wrong size!
- fi
- chmod +x 'testmenu.c'
- # end of 'testmenu.c'
- fi
- if test -f 'testmenu.o.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'testmenu.o.uu'\"
- else
- echo shar: Extracting \"'testmenu.o.uu'\" \(2424 characters\)
- sed "s/^X//" >'testmenu.o.uu' <<'END_OF_FILE'
- Xbegin 700 testmenu.o
- XM```#YP````````/H`````3(```````/J````%`````````````````,``0``-
- XM%``4`````````SP`````````"@*``&0"`0```P```A`.``````````````,00
- XM````````````````_____P`!```#[`````(````!````&````#H````````#$
- XM[P$```1?26YT=6ET:6]N0F%S90````````$```)?1V9X0F%S90````0!```":
- XM7W=I;F1O=P`````(`0```E]7:6Y497AT````#`$```-?3F5W5VEN9&]W````%
- XM```@`````````_(```/H`````3$```````/I````V$Y5__9(YQP`<``H`$ZYX
- XM```!FG`!('D````((&@`5A(H``]T`!0!(@+CH"8`2H1F(B\#3KD`````6$\J*
- XM`,"#9Q`O.0````A.N0```&183R@`8-I"ITZY```"3%A/3-\`.$Y=3G5.5?_D:
- XM2.<?.$7Y`````'``+`!P`"@`(&T`""\H`%9.N0````!83R@`9P`!`B!$*V@`Q
- XM%/_P($0[:``8__PO!$ZY`````%A/<``@+?_P3KD`````````S@```@````#67
- XM```!``````````&,<`$L`&```+AP`#`M__Q(P"8`#(/_____9P``H"`#`H``P
- XM```?*$`@`^J``H`````_)D!P"R(#X*$"@0```!\J`2\#+SD`````3KD`````*
- XM4$\@0#`H``Q(P"X`+PLO#$AY```"]DZ2WOP`#`R%````'V<,+P5(>0```NA.=
- XMDE!/(`<"@````0!G"DAY```"W$Z26$](>0```MI.DEA/+P,O.0````!.N0``W
- XM``!03R!`,"@`($C`)@!@`/]:8````F``_NP@!DS?'/A.74YU3E4``$CG`#!%D
- XM^0````A'^0```DQ(>``A2'D```+(3KD`````4$\CP``````@.0````!F"$AX+
- XM``5.DUA/2'@`(4AY```"MDZY`````%!/(\`````$(#D````$9@A(>``%3I-8]
- XM3TAY````($ZY`````%A/)(`@$F8(2'@`!4Z36$]"IT*G2'D````,(%(O*``R)
- XM3KD`````WOP`$"\Y`````"\23KD`````4$],WPP`3EU.=4Y5```O"D7Y````_
- XM""`29QP@4B`H`!QG"B\23KD`````6$\O$DZY`````%A/(#D````$9PXO.0``<
- XM``1.N0````!83R`Y`````&<.+SD`````3KD`````6$\O+0`(3KD`````6$\D,
- XM7TY=3G5G<F%P:&EC<RYL:6)R87)Y``!I;G1U:71I;VXN;&EB<F%R>0`*`"`H9
- XM0VAE8VME9"D@`"P@<W5B:71E;2`E9```4V5L96-T960@;65N=2`E9"P@:71E3
- XM;2`E9`!497-T365N=2!6,2XP("@Q,BUO8W0M.3`I("T@8GD@2&%N<R!*86YS+
- XM96X``$%C=&EV871E($UE;G5)=&5M(&]R($-L;W-E1V%D9V5T``!.<0```^P`9
- XM```.`````````!8```!"```!I````<(```'(```!Z@```?````(````"(```7
- XM`E0```)Z```"@@```I````*8````#0````$````.````2````%8```"V````R
- XMO@```,H```$N```!1````5@```%B```!J@```;0```'<`````````^\!```"J
- XM7VUA:6X``````````0```U]H86YD;&5)1$--4````&0!```"7T]P96Y!;&P`Q
- XM``&:`0```U]C;&5A;D5X:70``````DR!```"7U=A:70````````!````-($`6
- XM``)?<')I;G1F``````$```!N@0```E]'971-<V<``````0```(2!```#7U)EK
- XM<&QY37-G`````````0```*2!```"+F-S=VET8V@````!````LH$```)?37E-O
- XM96YU``````,```$2```!;@```C:!```#7TET96U!9&1R97-S`````@```1@`8
- XM``%T@0```U]/<&5N3&EB<F%R>0````(```&Z```!XH$```-?3W!E;E=I;F1O5
- XM=P`````!```"!H$```-?4')I;G1)5&5X=``````!```"+($```1?4V5T365N]
- XM=5-T<FEP`````````0```CZ!```$7T-L96%R365N=5-T<FEP``````$```)HE
- XM@0```U]#;&]S95=I;F1O=P````$```)R@0``!%]#;&]S94QI8G)A<GD`````U
- XG```"```"B````IZ!```"7V5X:70````````!```"J@````````/RJ
- X``
- Xend
- Xsize 1704
- END_OF_FILE
- if test 2424 -ne `wc -c <'testmenu.o.uu'`; then
- echo shar: \"'testmenu.o.uu'\" unpacked with wrong size!
- fi
- # end of 'testmenu.o.uu'
- fi
- echo shar: End of archive 1 \(of 2\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked both archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
- Mail comments to the moderator at <amiga-request@uunet.uu.net>.
- Post requests for sources, and general discussion to comp.sys.amiga.misc.
-